/* Production Tracking System - Clean Professional RTL Stylesheet */
:root {
    --font-sans: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    
    --teal-brand: #007791;
    --teal-light: #e6f4f6;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --success-text: #065f46;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-text: #92400e;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-text: #991b1b;
    
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --purple-text: #5b21b6;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #ffffff;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 18px;
}

.logo-box {
    width: 36px;
    height: 36px;
    background: #007791;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
}

.logo-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    margin: 14px 10px 8px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--teal-light);
    color: var(--teal-brand);
    font-weight: 700;
}

.nav-item.nav-live {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px dashed #86efac;
    margin-top: 6px;
}

.live-dot-badge {
    background: #22c55e;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-right: auto;
}

.nav-icon {
    width: 17px;
    height: 17px;
    stroke-width: 2;
    flex-shrink: 0;
}

.sidebar-footer-note {
    margin-top: auto;
    padding: 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.sidebar-role-selector {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.sidebar-role-selector label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 5px;
}

.sidebar-role-selector select {
    width: 100%;
    padding: 7px 8px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    cursor: pointer;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

/* Top App Bar */
.top-bar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-sep {
    color: var(--text-dim);
}

.breadcrumb-active {
    color: var(--text-primary);
    font-weight: 600;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.action-buttons-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown-container {
    position: relative;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.user-profile-badge:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-role-sub {
    font-size: 10.5px;
    color: var(--text-dim);
}

.chevron-user-icon {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
    transition: transform 0.2s ease;
}

.user-profile-badge.active .chevron-user-icon {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    padding: 8px;
    z-index: 100;
}

.user-dropdown-menu.active {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    padding: 6px 8px 4px 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.user-dropdown-item:hover {
    background-color: #f8fafc;
}

.user-dropdown-item.active {
    background-color: #f0fdfa;
    border-right: 3px solid #0d9488;
}

.dropdown-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #f1f5f9;
    flex-shrink: 0;
}

.dropdown-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dropdown-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.dropdown-desc {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Page Header */
.page-header {
    padding: 24px 32px 14px 32px;
}

.header-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.role-permission-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.role-badge-pill {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* View Panels */
.view-panel {
    display: none;
    padding: 0 32px 32px 32px;
}

.view-panel.active {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #0284c7;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #0369a1;
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-icon {
    width: 15px;
    height: 15px;
}

/* Top 4 KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.15s ease;
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.kpi-title {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin: 8px 0 4px 0;
}

.kpi-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.text-red {
    color: #dc2626 !important;
}

.text-green {
    color: #16a34a !important;
}

.text-amber {
    color: #d97706 !important;
}

.text-blue {
    color: #0284c7 !important;
}

/* Filters Card */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.filter-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 160px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select {
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: var(--primary);
}

.filter-search-group {
    flex: 1;
    min-width: 220px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 10px;
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 8px 34px 8px 12px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
}

.filter-reset-group {
    min-width: auto;
}

/* Plans Table Card */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header-bar {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

.table-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.table-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.table-badge-counter {
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.table-responsive {
    overflow-x: auto;
}

.plans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: right;
}

.plans-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12.5px;
    white-space: nowrap;
}

.plans-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.plans-table tr:hover td {
    background-color: #f8fafc;
    cursor: pointer;
}

.plans-table tr.selected td {
    background-color: #f0fdfa;
    border-color: #99f6e4;
}

/* Table Specific Cell Styles */
.plan-company-product {
    display: flex;
    flex-direction: column;
}

.plan-company-name {
    font-weight: 600;
    color: var(--text-primary);
}

.plan-formula-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.plan-batch-code {
    font-family: monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13.5px;
}

/* Progress bar inside table cell */
.table-progress-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.table-progress-bg {
    flex: 1;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.table-progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px;
}

.table-progress-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 32px;
    text-align: left;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning-text);
}

.badge-info {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-cyan {
    background-color: #e0f2fe;
    color: #0284c7;
}

.badge-purple {
    background-color: var(--purple-light);
    color: var(--purple-text);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger-text);
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success-text);
}

/* Lower Section Grid (Matching Screenshot 2) */
.dashboard-details-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 22px;
}

.detail-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.detail-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-card-subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stage Distribution Bar List */
.stage-dist-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stage-dist-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stage-dist-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
}

.stage-dist-name {
    color: var(--text-secondary);
    font-weight: 600;
}

.stage-dist-count {
    color: var(--text-muted);
    font-weight: 500;
}

.stage-dist-bar-bg {
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
}

.stage-dist-bar-fill {
    height: 100%;
    background-color: #0284c7;
    border-radius: 6px;
}

/* Selected Plan Detailed Card */
.selected-plan-headline {
    font-size: 14px;
    font-weight: 700;
    color: #0369a1;
    margin-top: 2px;
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 4-Grid Spec Metadata */
.plan-spec-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.plan-spec-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.plan-spec-label {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.plan-spec-value {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

/* General Progress Bar Section */
.general-progress-section {
    margin-bottom: 24px;
}

.general-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.general-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.general-progress-pct {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
}

.progress-bar-lg {
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill-lg {
    height: 100%;
    background-color: #0284c7;
    border-radius: 6px;
    transition: width 0.4s ease;
}

/* 6-Stage Stepper Component */
.workflow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-muted);
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.step-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.step-node.completed .step-circle {
    background: #e6f4f6;
    border-color: #0d9488;
    color: #0d9488;
}

.step-node.completed .step-label {
    color: var(--text-primary);
}

.step-node.active .step-circle {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
    box-shadow: 0 0 0 4px #e0f2fe;
}

.step-node.active .step-label {
    color: var(--primary);
    font-weight: 700;
}

.step-connector {
    flex: 1;
    height: 2px;
    background-color: #cbd5e1;
    margin: 0 4px;
    transform: translateY(-11px);
}

.step-connector.completed {
    background-color: #0d9488;
}

.step-connector.active {
    background-color: #0284c7;
}

/* Checklist Items Section */
.checklist-items-section {
    margin-bottom: 18px;
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.checklist-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.checklist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.checklist-name-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-icon-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.check-icon-box.done {
    background: #d1fae5;
    color: #059669;
}

.check-icon-box.missing {
    background: #fee2e2;
    color: #dc2626;
}

.check-icon-box.pending {
    background: #fef3c7;
    color: #d97706;
}

.checklist-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.checklist-status-badge {
    font-size: 12px;
    font-weight: 600;
}

.plan-last-update {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 10px;
    text-align: left;
}

.watermark-note {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 12px;
    text-align: center;
    border-top: 1px dashed var(--border-light);
    padding-top: 10px;
}

/* Audit Trail Accordion */
.audit-trail-section {
    margin-top: 14px;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
}

.audit-summary {
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.chevron-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

details[open] .chevron-icon {
    transform: rotate(180deg);
}

.audit-timeline {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
    border-right: 2px solid #e2e8f0;
}

.audit-item {
    position: relative;
    font-size: 12px;
}

.audit-item::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.audit-item-meta {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 2px;
}

.audit-item-text {
    color: var(--text-primary);
    line-height: 1.4;
}

/* Companies Grid View */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.company-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-card);
}

.company-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.company-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.company-products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.company-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}

/* Reports Sheet */
.reports-container {
    max-width: 900px;
    margin: 0 auto;
}

.report-selection-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.report-select-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    align-items: center;
}

.printable-report-sheet {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 36px 42px;
    box-shadow: var(--shadow-md);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.report-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.report-company-title {
    font-size: 16px;
    font-weight: 800;
}

.report-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.report-meta-box {
    text-align: left;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-title-bar {
    background: #f1f5f9;
    padding: 10px 16px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
}

.report-title-bar h3 {
    font-size: 15px;
    font-weight: 700;
}

.report-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: #f8fafc;
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    font-size: 13px;
}

.report-section-h4 {
    font-size: 13.5px;
    font-weight: 700;
    margin: 18px 0 8px 0;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.report-text-block {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    background: #ffffff;
    padding: 8px 12px;
    border: 1px dashed var(--border-color);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px 0;
    font-size: 12px;
}

.report-table th, .report-table td {
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    text-align: right;
}

.report-table th {
    background-color: #f1f5f9;
    font-weight: 700;
}

.signatures-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.sign-box {
    border: 1px solid #cbd5e1;
    padding: 10px 8px;
    text-align: center;
    background: #fafafa;
    border-radius: 4px;
    font-size: 11.5px;
}

.sign-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 11px;
}

.sign-status {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sign-person {
    color: var(--text-dim);
    font-size: 10.5px;
}

/* Modals */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalSlide 0.2s ease-out;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-dim);
    cursor: pointer;
}

.modal-body {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: #f8fafc;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.flex-1 {
    flex: 1;
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
}

.action-choice-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.action-plan-summary {
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    border-right: 4px solid var(--primary);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: none;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print CSS */
@media print {
    body {
        background: #ffffff;
    }
    .sidebar, .top-bar, .page-header, .report-selection-card, .btn, .modal-backdrop, .toast {
        display: none !important;
    }
    .app-layout, .main-content, .view-panel {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .printable-report-sheet {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
    }
}
