@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
        :root { --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: var(--font-ui);
            background: linear-gradient(135deg, #0B1C2D 0%, #1a3a52 50%, #2a4a62 100%);
            min-height: 100vh;
            overflow-x: hidden;
        }

        /* --- SEU CSS ORIGINAL MANTIDO INTACTO --- */
        .login-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
        .login-container { background: white; border-radius: 20px; padding: 48px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
        .login-header { text-align: center; margin-bottom: 40px; }
        .login-logo { width: 80px; height: 80px; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); border-radius: 16px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 36px; color: white; }
        .login-title { font-size: 32px; font-weight: 800; color: #0B1C2D; margin-bottom: 8px; }
        .login-subtitle { font-size: 14px; color: #F57C00; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
        .form-group { margin-bottom: 20px; }
        .form-label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
        .form-input { width: 100%; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 15px; font-family: var(--font-ui); transition: all 0.3s; }
        .form-input:focus { outline: none; border-color: #F57C00; box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.1); }
        .btn { width: 100%; padding: 16px; border: none; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.3s; font-family: var(--font-ui); }
        .btn-primary { background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); color: white; box-shadow: 0 4px 12px rgba(245, 124, 0, 0.3); }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 124, 0, 0.4); }
        .alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
        .alert-error { background: #fee; color: #c00; border: 1px solid #fcc; }
        .alert-success { background: #efe; color: #0a0; border: 1px solid #cfc; }
        .alert-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
        .login-footer { margin-top: 24px; padding-top: 24px; border-top: 1px solid #e0e0e0; font-size: 13px; color: #666; text-align: center; }
        .app-wrapper { display: flex; min-height: 100vh; }
        .sidebar { width: 280px; background: rgba(11, 28, 45, 0.95); backdrop-filter: blur(10px); border-right: 1px solid rgba(255, 255, 255, 0.1); padding: 18px 20px 24px; display: flex; flex-direction: column; position: fixed; height: 100vh; overflow-y: auto; z-index: 1000; box-shadow: 4px 0 20px rgba(0,0,0,0.3); transition: width .25s ease, padding .25s ease; }
        .sidebar-topbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
        .logo-container { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 16px; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); border-radius: 12px; }
        .logo-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
        .logo-text { flex: 1; }
        .logo-title { font-size: 20px; font-weight: 800; color: white; letter-spacing: -0.5px; }
        .logo-subtitle { font-size: 10px; color: rgba(255,255,255,0.9); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
        .menu-section { margin-top: 32px; }
        .menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,0.5); padding: 0 16px 12px; }
        .menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 4px 0; border-radius: 10px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); color: rgba(255,255,255,0.7); font-weight: 500; font-size: 14px; position: relative; }
        .menu-item:hover { background: rgba(255,255,255,0.08); color: white; transform: translateX(4px); }
        .menu-item.active { background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); color: white; box-shadow: 0 4px 12px rgba(245, 124, 0, 0.3); }
        .menu-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 60%; background: white; border-radius: 0 4px 4px 0; }
        .menu-icon { width: 20px; text-align: center; font-size: 16px; }
        .badge { margin-left: auto; background: rgba(245, 124, 0, 0.2); color: #F57C00; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; }
        .main-content { flex: 1; min-width: 0; width: calc(100% - 280px); margin-left: 280px; padding: 32px; transition: margin-left .25s ease, width .25s ease; }
        .app-wrapper.sidebar-collapsed .sidebar { width: 82px; padding: 18px 12px 24px; }
        .app-wrapper.sidebar-collapsed .main-content { width: calc(100% - 82px); margin-left: 82px; }
        .app-wrapper.sidebar-collapsed .logo-container { justify-content: center; padding: 12px; }
        .app-wrapper.sidebar-collapsed .logo-text, .app-wrapper.sidebar-collapsed .menu-label, .app-wrapper.sidebar-collapsed .menu-item span:not(.badge) { display: none; }
        .app-wrapper.sidebar-collapsed .menu-section { margin-top: 24px; }
        .app-wrapper.sidebar-collapsed .menu-item { justify-content: center; padding: 14px; gap: 0; }
        .app-wrapper.sidebar-collapsed .menu-icon { width: auto; font-size: 18px; }
        .app-wrapper.sidebar-collapsed .badge { position: absolute; right: 6px; top: 6px; padding: 2px 5px; font-size: 10px; }
        .page-header { background: white; border-radius: 16px; padding: 32px; margin-bottom: 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); display: flex; justify-content: space-between; align-items: center; }
        .page-title { font-size: 32px; font-weight: 800; color: #0B1C2D; display: flex; align-items: center; gap: 16px; }
        .mobile-menu-toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #0B1C2D; color: white; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; flex: 0 0 auto; }
        .sidebar-overlay { display: none; }
        .sidebar-toggle { width: 34px; height: 34px; border: none; border-radius: 10px; background: rgba(255,255,255,.1); color: white; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; transition: all .2s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
        .sidebar-toggle:hover { background: #F57C00; box-shadow: 0 8px 20px rgba(245,124,0,.22); }
        .app-wrapper.sidebar-collapsed .sidebar-topbar { justify-content: center; }
        .page-icon { width: 48px; height: 48px; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; }
        .user-menu { display: flex; align-items: center; gap: 24px; }
        .user-identity, .user-actions { display: flex; align-items: center; }
        .user-identity { gap: 12px; }
        .user-actions { gap: 10px; padding-left: 20px; border-left: 1px solid #e2e8f0; }
        .notification-center { position: relative; }
        .notification-button { position: relative; width: 44px; height: 44px; border: 1px solid #dbe3ec; border-radius: 12px; background: #f8fafc; color: #0B1C2D; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; transition: all .2s; }
        .notification-button:hover, .notification-button[aria-expanded="true"] { color: #F57C00; border-color: #fdba74; background: #fff7ed; }
        .notification-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #dc2626; color: white; border: 2px solid white; font-size: 10px; line-height: 16px; font-weight: 800; text-align: center; }
        .notification-panel { position: absolute; z-index: 1200; right: 0; top: calc(100% + 12px); width: min(420px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 130px)); overflow: hidden; background: white; border: 1px solid #dbe3ec; border-radius: 16px; box-shadow: 0 22px 55px rgba(11,28,45,.22); }
        .notification-panel[hidden] { display: none; }
        .notification-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 18px 14px; border-bottom: 1px solid #e8edf3; }
        .notification-panel-header > div { display: flex; flex-direction: column; gap: 3px; }
        .notification-panel-header strong { color: #0B1C2D; font-size: 17px; }
        .notification-panel-header span { color: #64748b; font-size: 12px; }
        .notification-panel-header button { border: 0; background: transparent; color: #c2410c; font-size: 12px; font-weight: 800; cursor: pointer; padding: 4px 0; white-space: nowrap; }
        .notification-panel-header button:disabled { color: #94a3b8; cursor: default; }
        .notification-list { max-height: min(520px, calc(100vh - 210px)); overflow-y: auto; padding: 8px; }
        .notification-item { width: 100%; border: 0; border-radius: 12px; background: transparent; padding: 13px 11px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 8px; align-items: start; gap: 11px; text-align: left; cursor: pointer; transition: background .2s; }
        .notification-item:hover { background: #f1f5f9; }
        .notification-item.unread { background: #fffaf5; }
        .notification-item.unread:hover { background: #fff2e6; }
        .notification-item-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #dbeafe; color: #1d4ed8; }
        .notification-item.severity-critica .notification-item-icon { background: #fee2e2; color: #b91c1c; }
        .notification-item.severity-atencao .notification-item-icon { background: #ffedd5; color: #c2410c; }
        .notification-item-content { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
        .notification-item-title { color: #0B1C2D; font-size: 13px; font-weight: 800; }
        .notification-item-message { color: #64748b; font-size: 12px; line-height: 1.42; }
        .notification-unread-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #F57C00; }
        .notification-item.read { opacity: .72; }
        .notification-empty { padding: 38px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; color: #64748b; }
        .notification-empty i { color: #10b981; font-size: 28px; margin-bottom: 10px; }
        .notification-empty strong { color: #0B1C2D; margin-bottom: 4px; }
        .notification-empty span { font-size: 12px; }
        .user-avatar { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #0B1C2D 0%, #1a3a52 100%); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 16px; }
        .user-name { font-weight: 600; color: #333; }
        .btn-logout { padding: 10px 20px; background: transparent; border: 2px solid #F57C00; color: #F57C00; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
        .btn-logout:hover { background: #F57C00; color: white; }
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 32px; }
        .stat-card { background: white; border-radius: 16px; padding: 28px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
        .stat-card::before { content: ''; position: absolute; top: 0; right: 0; width: 120px; height: 120px; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); opacity: 0.05; border-radius: 0 0 0 100%; }
        .stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
        .stat-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #666; margin-bottom: 12px; }
        .stat-value { font-size: 36px; font-weight: 800; color: #0B1C2D; line-height: 1; margin-bottom: 8px; }
        .stat-change { font-size: 13px; font-weight: 600; }
        .stat-change.positive { color: #10B981; }
        .stat-change.negative { color: #EF4444; }
        .reports-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 30px; }
        .report-stat-card { min-height: 128px; padding: 24px; border: 1px solid #e7edf4; background: linear-gradient(135deg, #ffffff 0%, #fff8f2 100%); box-shadow: 0 10px 26px rgba(11,28,45,.08); display: flex; flex-direction: column; justify-content: center; }
        .report-stat-card::before { width: 82px; height: 82px; opacity: .08; border-radius: 50%; right: -24px; top: -24px; }
        .report-stat-card .stat-label { color: #475569; font-size: 12px; font-weight: 800; margin-bottom: 10px; }
        .report-stat-card .stat-value { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.08; margin: 0; overflow-wrap: anywhere; }
        .card { background: white; border-radius: 16px; padding: 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); margin-bottom: 24px; }
        .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #f0f0f0; }
        .card-title { font-size: 24px; font-weight: 700; color: #0B1C2D; }
        .btn-add { padding: 12px 24px; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); color: white; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; }
        .btn-add:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245, 124, 0, 0.3); }
        .materials-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; align-items: end; margin-bottom: 24px; }
        .materials-toolbar .search-box { margin-bottom: 0; }
        .materials-status-filter { display: flex; flex-direction: column; gap: 6px; }
        .toolbar-label { font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
        .active-filter { align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 18px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%); border: 1px solid #fed7aa; color: #9a3412; font-size: 13px; font-weight: 700; box-shadow: 0 8px 20px rgba(154,52,18,.06); }
        .active-filter span::before { content: '\f0b0'; font-family: "Font Awesome 6 Free"; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 9px; color: #F57C00; background: #ffedd5; }
        .active-filter button { border: none; border-radius: 10px; background: #0B1C2D; color: white; padding: 8px 12px; font-weight: 800; cursor: pointer; transition: all .2s; }
        .active-filter button:hover { background: #F57C00; transform: translateY(-1px); }
        .search-box { position: relative; margin-bottom: 24px; }
        .search-input { width: 100%; padding: 14px 16px 14px 48px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 15px; transition: all 0.3s; }
        .search-input:focus { outline: none; border-color: #F57C00; box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.1); }
        .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #999; }
        .table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid #e0e0e0; }
        table { width: 100%; border-collapse: collapse; background: white; }
        thead { background: linear-gradient(135deg, #0B1C2D 0%, #1a3a52 100%); }
        th { padding: 16px; text-align: left; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: white; }
        td { padding: 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; vertical-align: middle; }
        tbody tr:hover { background: #f8f8f8; }
        thead tr:hover { background: transparent; transform: none; box-shadow: none; }
        .status-badge { display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
        .status-success { background: #d1fae5; color: #065f46; }
        .status-warning { background: #fef3c7; color: #92400e; }
        .status-danger { background: #fee2e2; color: #991b1b; }
        .status-info { background: #dbeafe; color: #1e40af; }
        th.actions-column, td.actions-column { width: 132px; min-width: 132px; text-align: center; }
        .action-buttons { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
        .btn-action { width: 32px; height: 32px; border: none; border-radius: 6px; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; }
        .btn-edit { background: #dbeafe; color: #1e40af; }
        .btn-edit:hover { background: #3b82f6; color: white; }
        .btn-delete { background: #fee2e2; color: #991b1b; }
        .btn-delete:hover { background: #ef4444; color: white; }
        .btn-view { background: #d1fae5; color: #065f46; }
        .btn-view:hover { background: #10B981; color: white; }
        .btn-info { background: #e0f2fe; color: #075985; }
        .btn-info:hover { background: #0284c7; color: white; }
        .btn-restore { background: #dcfce7; color: #166534; }
        .btn-restore:hover { background: #16a34a; color: white; }
        .row-muted { background: #f8fafc; color: #64748b; }
        .row-muted td { opacity: .82; }
        .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 2000; align-items: center; justify-content: center; }
        .modal.active { display: flex; }
        .modal-content { background: white; border-radius: 20px; max-width: 700px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: slideUp 0.3s ease; }
        .modal-wide { max-width: 960px; }
        @keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .modal-header { padding: 24px 32px; border-bottom: 2px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
        .modal-title { font-size: 24px; font-weight: 700; color: #0B1C2D; }
        .modal-close { width: 36px; height: 36px; border: none; background: #f0f0f0; border-radius: 8px; cursor: pointer; font-size: 20px; color: #666; transition: all 0.3s; }
        .modal-close:hover { background: #e0e0e0; color: #333; }
        .modal-body { padding: 32px; }
        .modal-footer { padding: 24px 32px; border-top: 2px solid #f0f0f0; display: flex; gap: 12px; justify-content: flex-end; }
        .btn-secondary { padding: 12px 24px; background: #f0f0f0; color: #333; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
        .btn-secondary:hover { background: #e0e0e0; }
        .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 20px; }
        .form-select, .form-textarea { width: 100%; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 15px; font-family: var(--font-ui); transition: all 0.3s; }
        .form-select:focus, .form-textarea:focus { outline: none; border-color: #F57C00; box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.1); }
        .form-textarea { resize: vertical; min-height: 100px; }
        .empty-state { text-align: center; padding: 60px 20px; color: #999; }
        .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
        .empty-text { font-size: 18px; font-weight: 600; }
        .material-details { display: grid; gap: 22px; }
        .material-details-header { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: stretch; }
        .material-details-photo { min-height: 180px; border-radius: 16px; background: #f8fafc; border: 1px solid #e2e8f0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
        .material-details-photo img { width: 100%; height: 100%; object-fit: cover; }
        .material-details-placeholder { color: #cbd5e1; font-size: 52px; }
        .material-details-main { border: 1px solid #e2e8f0; border-radius: 16px; padding: 22px; background: #fff; display: flex; flex-direction: column; justify-content: center; }
        .material-details-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
        .material-details-code { font-size: 12px; font-weight: 800; color: #F57C00; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 4px; }
        .material-details-main h4 { font-size: 28px; color: #0B1C2D; margin: 0; }
        .material-details-main p { color: #475569; margin: 0 0 18px; }
        .material-stock-bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
        .material-stock-bar span { display: block; height: 100%; background: linear-gradient(135deg, #10B981 0%, #F57C00 100%); border-radius: inherit; }
        .material-details-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
        .material-details-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .material-detail-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; background: #f8fafc; }
        .material-detail-card span { display: block; font-size: 12px; color: #64748b; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
        .material-detail-card strong { color: #0B1C2D; font-size: 20px; }
        .material-details-section-title { font-size: 16px; font-weight: 800; color: #0B1C2D; margin-bottom: 12px; }
        .material-details-history { display: grid; gap: 10px; }
        .material-history-item { display: grid; grid-template-columns: 120px 1fr 160px 120px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
        .material-history-item small, .material-history-item span:not(.status-badge) { color: #64748b; }
        .material-details-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
        .view { display: none; }
        .view.active { display: block; }
        .report-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 24px; }
        .btn-report { padding: 20px; background: white; border: 2px solid #e0e0e0; border-radius: 12px; cursor: pointer; transition: all 0.3s; text-align: left; display: flex; align-items: center; gap: 16px; }
        .btn-report:hover { border-color: #F57C00; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
        .report-icon { width: 48px; height: 48px; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; }
        .report-info { flex: 1; }
        .report-title { font-weight: 700; font-size: 16px; color: #0B1C2D; margin-bottom: 4px; }
        .report-desc { font-size: 13px; color: #666; }
.report-result { margin-top: 28px; padding: 22px; }
.report-result-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.report-result-title { font-size: 20px; font-weight: 800; color: #0B1C2D; }
.report-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 14px;
    border: 1px solid #d6e1ec;
    background: #fff;
}
.report-data-table {
    min-width: 920px;
    table-layout: auto;
}
.report-data-table th,
.report-data-table td {
    white-space: nowrap;
}
.report-data-table th:first-child { border-top-left-radius: 12px; }
.report-data-table th:last-child { border-top-right-radius: 12px; }
.report-data-table tbody tr:last-child td {
    border-bottom: 0;
}
        .btn-export { width: auto; padding: 10px 16px; border-radius: 10px; border: none; background: #0B1C2D; color: white; font-weight: 700; cursor: pointer; }
        .card-subtitle { margin-top: 6px; color: #64748b; font-size: 14px; font-weight: 600; }
        .reports-filter-panel { margin: 8px 0 24px; padding: 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%); }
        .reports-filter-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
        .reports-filter-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
        .reports-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
        .reports-filter-grid .form-group { margin-bottom: 0; }
        .btn-report.active { border-color: #F57C00; background: #fff7ed; box-shadow: 0 8px 22px rgba(245,124,0,.12); }
        .btn-report.active .report-title { color: #9a3412; }
        .quick-filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
        .quick-filter-btn { border: 1px solid #e2e8f0; background: #f8fafc; color: #0B1C2D; border-radius: 999px; padding: 9px 13px; font-size: 13px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all .2s; }
        .quick-filter-btn:hover { background: #fff7ed; border-color: #fed7aa; color: #9a3412; transform: translateY(-1px); }
        .log-details { display: grid; gap: 18px; }
        .log-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
        .log-summary-grid > div { padding: 14px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; }
        .log-summary-grid span { display: block; color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
        .log-summary-grid strong { color: #0B1C2D; font-size: 14px; overflow-wrap: anywhere; }
        .log-description { padding: 14px 16px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-weight: 700; }
        .log-diff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
        .log-diff-card { border: 1px solid #e2e8f0; border-radius: 16px; background: white; padding: 16px; min-width: 0; }
        .log-diff-card h4 { margin-bottom: 12px; color: #0B1C2D; font-size: 16px; }
        .log-kv-list { display: grid; gap: 8px; }
        .log-kv-list div { display: grid; grid-template-columns: minmax(120px, .38fr) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
        .log-kv-list dt { color: #64748b; font-weight: 800; font-size: 12px; }
        .log-kv-list dd { color: #0B1C2D; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
        .chart-container { position: relative; height: 300px; margin-top: 24px; }
        .dashboard-hero { background: radial-gradient(circle at top right, rgba(245,124,0,.34), transparent 34%), linear-gradient(135deg, #0B1C2D 0%, #173a54 62%, #10263b 100%); color: white; border-radius: 22px; padding: 32px; margin-bottom: 24px; box-shadow: 0 18px 45px rgba(11,28,45,0.24); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 24px; align-items: center; overflow: hidden; }
        .dashboard-hero-content { min-width: 0; }
        .dashboard-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.72); font-weight: 800; margin-bottom: 10px; }
        .dashboard-hero-title { font-size: clamp(28px, 3vw, 40px); line-height: 1.08; font-weight: 800; margin-bottom: 12px; max-width: 780px; }
        .dashboard-hero-copy { color: rgba(255,255,255,.80); font-size: 15px; line-height: 1.6; max-width: 760px; }
        .dashboard-health { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 22px; backdrop-filter: blur(8px); }
        .health-label { font-size: 13px; color: rgba(255,255,255,.76); font-weight: 700; margin-bottom: 8px; }
        .health-value { font-size: 46px; font-weight: 800; line-height: 1; margin-bottom: 12px; }
        .health-bar { height: 10px; background: rgba(255,255,255,.20); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
        .health-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #10B981 0%, #F57C00 100%); border-radius: 999px; transition: width .4s; }
        .health-meta { color: rgba(255,255,255,.76); font-size: 13px; }
        .dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
        .metric-card { min-width: 0; background: white; border-radius: 18px; padding: 22px; box-shadow: 0 8px 28px rgba(11,28,45,.08); border: 1px solid rgba(11,28,45,.06); position: relative; overflow: hidden; }
        .metric-card::before { content: ''; position: absolute; right: -26px; top: -26px; width: 92px; height: 92px; border-radius: 50%; background: rgba(245,124,0,.09); }
        .metric-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; background: linear-gradient(135deg, #F57C00 0%, #E65100 100%); margin-bottom: 18px; position: relative; z-index: 1; }
        .metric-label { color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; overflow-wrap: anywhere; }
        .metric-value { color: #0B1C2D; font-size: clamp(25px, 2.4vw, 34px); font-weight: 800; line-height: 1.05; margin-bottom: 8px; overflow-wrap: anywhere; }
        .metric-note { color: #64748b; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
        .metric-note span { color: #0B1C2D; font-weight: 800; }
        .dashboard-clickable { cursor: pointer; position: relative; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
        .dashboard-clickable:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(11,28,45,.14); border-color: rgba(245,124,0,.34); }
        .dashboard-clickable::after { content: '\f061'; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 18px; bottom: 16px; width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #F57C00; background: #fff7ed; opacity: 0; transform: translateX(-6px); transition: all .2s ease; }
        .dashboard-clickable:hover::after { opacity: 1; transform: translateX(0); }
        .dashboard-panel.dashboard-clickable::after { top: 18px; bottom: auto; transform: translateX(-6px); }
        .dashboard-panel.dashboard-clickable:hover::after { transform: translateX(0); }
        .dashboard-panel.dashboard-clickable .panel-header { padding-right: 42px; }
        .operational-base-grid .dashboard-clickable { padding-right: 54px; }
        .operational-base-grid .dashboard-clickable::after { right: 14px; top: 50%; bottom: auto; transform: translate(0, -50%); width: 24px; height: 24px; font-size: 11px; opacity: 1; }
        .operational-base-grid .dashboard-clickable:hover::after { transform: translate(3px, -50%); }
        .dashboard-link { border: 1px solid transparent; border-radius: 999px; background: rgba(245,124,0,.08); padding: 2px 7px; color: #0B1C2D; font: inherit; font-weight: 800; cursor: pointer; transition: all .2s; }
        .dashboard-link:hover { color: #9a3412; background: #ffedd5; border-color: #fed7aa; text-decoration: none; }
        .dashboard-link:focus-visible, .chart-toggle-btn:focus-visible, .active-filter button:focus-visible { outline: 3px solid rgba(245,124,0,.28); outline-offset: 2px; }
        .dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, .86fr); grid-template-areas: "graficos graficos alertas" "ultimas ultimas eventos" "base base base"; gap: 20px; align-items: stretch; min-width: 0; }
        .dashboard-grid > * { min-width: 0; }
        .dashboard-panel { min-width: 0; background: white; border-radius: 18px; padding: 24px; box-shadow: 0 8px 28px rgba(11,28,45,.08); border: 1px solid rgba(11,28,45,.06); margin-bottom: 0; display: flex; flex-direction: column; }
        .dashboard-panel-graficos { grid-area: graficos; }
        .dashboard-panel-alertas { grid-area: alertas; }
        .dashboard-panel-ultimas { grid-area: ultimas; }
        .dashboard-panel-eventos { grid-area: eventos; }
        .dashboard-panel-base { grid-area: base; }
        .panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
        .panel-title { font-size: 18px; font-weight: 800; color: #0B1C2D; margin-bottom: 6px; }
        .panel-subtitle { font-size: 13px; color: #64748b; }
        .mini-chart { position: relative; height: 300px; flex: 1; min-height: 260px; }
        .dashboard-chart-pane { display: none; }
        .dashboard-chart-pane.active { display: block; }
        .chart-toggle { display: inline-flex; gap: 6px; padding: 5px; background: #eef2f7; border: 1px solid #cbd5e1; border-radius: 12px; flex: 0 0 auto; }
        .chart-toggle-btn { border: none; border-radius: 9px; padding: 9px 12px; background: transparent; color: #334155; font-size: 12px; font-weight: 800; cursor: pointer; transition: all .2s; }
        .chart-toggle-btn:hover { color: #0B1C2D; background: #e2e8f0; }
        .chart-toggle-btn.active { background: #0B1C2D; color: #fff; box-shadow: 0 6px 16px rgba(11,28,45,.18); }
        .insight-list { display: flex; flex-direction: column; gap: 12px; }
        .insight-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef2f7; min-width: 0; }
        .insight-item.warning { background: #fff7ed; border-color: #fed7aa; }
        .insight-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #dbeafe; color: #1e40af; flex: 0 0 auto; }
        .insight-item.warning .insight-icon { background: #ffedd5; color: #c2410c; }
        .insight-main { flex: 1; min-width: 0; }
        .insight-title { color: #0B1C2D; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .insight-meta { color: #64748b; font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .insight-value { color: #0B1C2D; font-weight: 800; font-size: 14px; margin-left: auto; }
        .operational-base-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
        .empty-compact { color: #94a3b8; text-align: center; padding: 26px 12px; font-weight: 700; background: #f8fafc; border-radius: 14px; }
        @media (max-width: 1200px) {
            .dashboard-hero { grid-template-columns: minmax(0, 1fr); }
            .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "graficos graficos" "alertas eventos" "ultimas ultimas" "base base"; }
            .reports-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .reports-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }
        .sidebar::-webkit-scrollbar { width: 6px; }
        .sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 10px; }
        .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }
        .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
        @media (max-width: 768px) {
            body.mobile-menu-open { overflow: hidden; }
            .sidebar { width: min(300px, 86vw); transform: translateX(-105%); transition: transform 0.3s; }
            .sidebar.mobile-open { transform: translateX(0); }
            .app-wrapper.sidebar-collapsed .sidebar { width: min(300px, 86vw); padding: 18px 20px 24px; transform: translateX(-105%); }
            .app-wrapper.sidebar-collapsed .sidebar.mobile-open { transform: translateX(0); }
            .app-wrapper.sidebar-collapsed .logo-container { justify-content: flex-start; padding: 16px; }
            .app-wrapper.sidebar-collapsed .logo-text, .app-wrapper.sidebar-collapsed .menu-label, .app-wrapper.sidebar-collapsed .menu-item span:not(.badge) { display: block; }
            .app-wrapper.sidebar-collapsed .menu-section { margin-top: 32px; }
            .app-wrapper.sidebar-collapsed .menu-item { justify-content: flex-start; padding: 14px 16px; gap: 14px; }
            .app-wrapper.sidebar-collapsed .menu-icon { width: 20px; font-size: 16px; }
            .app-wrapper.sidebar-collapsed .badge { position: static; margin-left: auto; padding: 2px 8px; font-size: 11px; }
            .app-wrapper.sidebar-collapsed .main-content { width: 100%; margin-left: 0; }
            .sidebar-topbar { justify-content: flex-end; }
            .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 990; background: rgba(3, 12, 22, .62); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
            .sidebar-overlay.active { opacity: 1; visibility: visible; }
            .main-content { width: 100%; margin-left: 0; padding: 20px; }
            .page-header { flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px; }
            .page-title { font-size: 26px; }
            .mobile-menu-toggle { display: inline-flex; }
            .user-menu { width: 100%; justify-content: space-between; gap: 14px; }
            .user-actions { padding-left: 0; border-left: 0; }
            .notification-panel { position: fixed; top: 96px; right: 16px; left: 16px; width: auto; }
            .stats-grid { grid-template-columns: 1fr; }
            .reports-stats-grid { grid-template-columns: 1fr; }
            .reports-filter-header { flex-direction: column; }
            .reports-filter-actions { width: 100%; }
            .reports-filter-actions .btn-secondary, .reports-filter-actions .btn-add { width: 100%; justify-content: center; }
            .reports-filter-grid { grid-template-columns: 1fr; }
            .log-summary-grid, .log-diff-grid { grid-template-columns: 1fr; }
            .log-kv-list div { grid-template-columns: 1fr; }
            .dashboard-metrics { grid-template-columns: 1fr; }
            .dashboard-grid { grid-template-columns: 1fr; grid-template-areas: "graficos" "alertas" "eventos" "ultimas" "base"; }
            .dashboard-hero { padding: 24px; }
            .panel-header { flex-direction: column; }
            .chart-toggle { width: 100%; }
            .chart-toggle-btn { flex: 1; }
            .operational-base-grid { grid-template-columns: 1fr; }
            .materials-toolbar { grid-template-columns: 1fr; }
            .active-filter { flex-direction: column; align-items: flex-start; }
            .active-filter button { width: 100%; }
            .material-details-header, .material-details-grid, .material-details-grid.compact { grid-template-columns: 1fr; }
            .material-history-item { grid-template-columns: 1fr; align-items: flex-start; }
        }
        @media (max-width: 480px) {
            .main-content { padding: 14px; }
            .page-header, .card, .dashboard-panel, .metric-card { padding: 18px; }
            .dashboard-hero { padding: 20px; border-radius: 16px; }
            .dashboard-hero-title { font-size: 26px; }
            .health-value { font-size: 34px; }
            .mini-chart { height: 220px; }
            .insight-item { align-items: flex-start; }
            .insight-value { margin-left: auto; }
            .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
            .page-title { width: 100%; gap: 10px; font-size: 24px; }
            .user-actions { gap: 8px; }
            .btn-logout { width: 44px; padding: 0; border-width: 1px; }
            .btn-logout span { display: none; }
        }

/* ==================== MOTION SYSTEM 2026 ==================== */
button, input, select, textarea, table {
    font-family: var(--font-ui);
}

:root {
    --motion-spring: cubic-bezier(.22, 1, .36, 1);
    --motion-smooth: cubic-bezier(.4, 0, .2, 1);
    --motion-fast: 180ms;
    --motion-medium: 420ms;
}

@keyframes view-reveal {
    from { opacity: 0; transform: translateY(10px); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes surface-reveal {
    from { opacity: 0; transform: translateY(24px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-backdrop-in {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

@keyframes modal-content-in {
    from { opacity: 0; transform: translateY(30px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ripple-expand {
    from { opacity: .3; transform: scale(0); }
    to { opacity: 0; transform: scale(1); }
}

@keyframes notification-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,124,0,0); }
    45% { box-shadow: 0 0 0 7px rgba(245,124,0,.12); }
}

@keyframes notification-ring {
    0%, 84%, 100% { transform: rotate(0); }
    87% { transform: rotate(14deg); }
    90% { transform: rotate(-12deg); }
    93% { transform: rotate(9deg); }
    96% { transform: rotate(-5deg); }
}

@keyframes badge-pop {
    0% { opacity: 0; transform: scale(.4) rotate(-12deg); }
    70% { transform: scale(1.15) rotate(3deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

.view.active {
    animation: view-reveal 360ms var(--motion-spring) both;
}

.motion-enter {
    animation: surface-reveal 620ms var(--motion-spring) both;
    animation-delay: calc(var(--motion-index, 0) * 55ms);
}

.page-header {
    isolation: isolate;
    border: 1px solid rgba(255,255,255,.75);
    transition: transform var(--motion-medium) var(--motion-spring), box-shadow var(--motion-medium) ease;
}

.page-header:hover {
    box-shadow: 0 14px 42px rgba(11,28,45,.13);
}

.card, .metric-card, .dashboard-panel, .stat-card, .btn-report {
    transition: transform 300ms var(--motion-spring), box-shadow 300ms ease, border-color 220ms ease;
}

.card:hover, .metric-card:hover, .dashboard-panel:hover {
    border-color: rgba(245,124,0,.22);
    box-shadow: 0 18px 46px rgba(11,28,45,.13);
}

.metric-card:hover, .dashboard-panel.dashboard-clickable:hover {
    transform: translateY(-5px);
}

.dashboard-hero {
    position: relative;
    isolation: isolate;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(360px circle at var(--pointer-x, 75%) var(--pointer-y, 15%), rgba(255,255,255,.16), transparent 64%);
    opacity: .65;
    transition: opacity 300ms ease;
}

.dashboard-hero:hover::after { opacity: 1; }

button, .menu-item {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

button:active, .menu-item:active {
    transform: scale(.97);
    transition-duration: 80ms;
}

.motion-ripple {
    position: absolute;
    z-index: 20;
    border-radius: 50%;
    pointer-events: none;
    background: currentColor;
    animation: ripple-expand 650ms ease-out forwards;
}

.menu-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.14) 48%, transparent 66%);
    transform: translateX(-120%);
    transition: transform 550ms ease;
}

.menu-item:hover::after { transform: translateX(120%); }

.menu-item.active .menu-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.18));
}

.menu-icon { transition: transform 260ms var(--motion-spring), filter 260ms ease; }

.sidebar {
    transition: width 320ms var(--motion-spring), padding 320ms var(--motion-spring), transform 320ms var(--motion-spring);
}

.notification-button.has-notifications {
    color: #F57C00;
    border-color: #fed7aa;
    animation: notification-pulse 2.8s ease-in-out infinite;
}

.notification-button { overflow: visible; }
.notification-button.has-notifications > i {
    transform-origin: 50% 12%;
    animation: notification-ring 7s ease-in-out infinite;
}

.notification-badge {
    top: -7px;
    right: -7px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-color: #fff;
    background: #F57C00;
    line-height: 17px;
    box-shadow: 0 5px 12px rgba(194,65,12,.3);
}

.notification-badge { animation: badge-pop 420ms var(--motion-spring) both; }

.notification-panel:not([hidden]) {
    z-index: 1250;
    transform-origin: top right;
    animation: modal-content-in 300ms var(--motion-spring) both;
}

.modal.active { animation: modal-backdrop-in 240ms ease both; }
.modal.active .modal-content { animation: modal-content-in 430ms var(--motion-spring) both; }

tbody tr {
    transition: background-color var(--motion-fast) ease, transform var(--motion-fast) var(--motion-spring), box-shadow var(--motion-fast) ease;
}

tbody tr:hover {
    transform: translateX(3px);
    box-shadow: -3px 0 0 #F57C00;
}

.btn-action:hover { transform: translateY(-2px) scale(1.08); }

input, select, textarea {
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

input:focus, select:focus, textarea:focus {
    transform: translateY(-1px);
}

:focus-visible {
    outline: 3px solid rgba(245,124,0,.32);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .motion-enter { animation-duration: 480ms; animation-delay: calc(var(--motion-index, 0) * 35ms); }
    .card:hover, .metric-card:hover, .dashboard-panel:hover { transform: none; }
    tbody tr:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* ==================== LAYOUT REFRESH: HEADER + DASHBOARD ==================== */
.page-header, .view {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    position: relative;
    z-index: 950;
    min-height: 76px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(18px);
}

.page-title {
    font-size: clamp(23px, 2vw, 29px);
    letter-spacing: -.7px;
}

.user-menu { gap: 18px; }
.user-actions { padding-left: 16px; }
.user-avatar { width: 40px; height: 40px; border-radius: 11px; }
.notification-button { width: 40px; height: 40px; border-radius: 11px; }
.btn-logout { min-height: 40px; padding: 8px 16px; }

.dashboard-hero {
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, .55fr);
    min-height: 260px;
    padding: clamp(28px, 3.4vw, 48px);
    border-radius: 26px;
    margin-bottom: 28px;
}

.dashboard-hero-title {
    max-width: 680px;
    font-size: clamp(30px, 3.2vw, 46px);
    letter-spacing: -1.35px;
}

.dashboard-hero-copy { max-width: 650px; }

.dashboard-health {
    padding: 24px;
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.dashboard-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 2px 14px;
}

.dashboard-section-heading-detail { margin-top: 6px; }
.dashboard-section-kicker {
    display: block;
    margin-bottom: 3px;
    color: #F57C00;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.dashboard-section-heading h2 {
    color: #ffffff;
    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -.35px;
    text-shadow: 0 2px 10px rgba(0,0,0,.18);
}

.dashboard-live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(134,239,172,.3);
    border-radius: 999px;
    background: rgba(240,253,244,.1);
    color: #bbf7d0;
    backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 800;
}

.dashboard-live-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}

.dashboard-metrics { gap: 14px; margin-bottom: 28px; }

.metric-card {
    min-height: 166px;
    padding: 20px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.metric-card::before {
    display: none;
}

.metric-icon {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 11px;
    box-shadow: 0 8px 18px rgba(245,124,0,.2);
}

.metric-label { padding-right: 48px; margin-bottom: 7px; }
.metric-value { font-size: clamp(27px, 2.4vw, 36px); letter-spacing: -1px; }
.metric-note { min-height: 22px; line-height: 1.55; }

.dashboard-grid { gap: 16px; }
.dashboard-panel { border-radius: 20px; }
.dashboard-panel-graficos { min-height: 410px; }

@media (min-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(310px, .72fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-hero { grid-template-columns: minmax(0, 1fr) minmax(240px, .45fr); }
}

@media (max-width: 900px) {
    .dashboard-hero { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .page-header { min-height: 0; padding: 18px; gap: 15px; }
    .page-title { font-size: 24px; }
    .user-menu { gap: 12px; }
    .dashboard-hero { min-height: 0; padding: 25px; border-radius: 22px; }
    .dashboard-hero-title { font-size: 30px; }
    .dashboard-section-heading { margin-bottom: 12px; }
    .metric-card { min-height: 154px; }
}

@media (max-width: 480px) {
    .page-header { padding: 14px; border-radius: 15px; }
    .page-title { font-size: 22px; }
    .mobile-menu-toggle { width: 40px; height: 40px; border-radius: 11px; }
    .user-menu { align-items: center; }
    .user-identity { gap: 10px; }
    .user-avatar, .notification-button, .btn-logout { width: 40px; height: 40px; min-height: 40px; }
    .dashboard-hero { padding: 22px; margin-bottom: 24px; }
    .dashboard-hero-title { font-size: 28px; letter-spacing: -.8px; }
    .dashboard-section-heading h2 { font-size: 18px; }
    .dashboard-live-status { padding: 6px 9px; }
    .metric-card { min-height: 146px; padding: 18px; }
}

/* ==================== OPERATIONAL MODULES ==================== */
.module-card {
    position: relative;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 22px;
    box-shadow: 0 14px 42px rgba(5,18,30,.14);
}

.module-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #F57C00, #ffb35c 38%, transparent 80%);
}

.module-card > .card-header {
    margin: 0 0 24px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid #e8edf3;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.module-header-copy { min-width: 0; }
.module-header-copy .card-title {
    margin: 0 0 5px;
    color: #0B1C2D;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -.45px;
}

.module-header-copy p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.module-card .btn-add {
    min-height: 42px;
    padding: 10px 17px;
    border-radius: 11px;
    box-shadow: 0 8px 20px rgba(245,124,0,.18);
}

.module-card > .module-toolbar,
.module-card > .module-search,
.module-card > .active-filter,
.module-card > .module-filter-panel {
    margin-right: 28px;
    margin-left: 28px;
}

.module-search { margin-bottom: 22px; }

.module-card .search-input {
    min-height: 46px;
    border-color: #dce4ed;
    background: #f8fafc;
}

.module-card .search-input:hover { border-color: #cbd5e1; }

.module-card .table-wrapper {
    margin: 0 28px 28px;
    border-color: #dce4ed;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(11,28,45,.05);
}

.module-card thead {
    background: linear-gradient(135deg, #0B1C2D 0%, #153a55 100%);
}

.module-card th {
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 11px;
    letter-spacing: .35px;
}

.module-card td { padding-top: 13px; padding-bottom: 13px; }

.module-card tbody tr:nth-child(even) { background: #fbfcfe; }
.module-card tbody tr:last-child td { border-bottom: 0; }

.module-filter-panel {
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid #dce4ed;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.module-filter-panel .form-grid { margin-bottom: 16px; }
.module-filter-panel .form-group { margin-bottom: 0; }
.module-filter-actions { display: flex; justify-content: flex-end; gap: 10px; }
.module-filter-actions .btn-secondary, .module-filter-actions .btn-add { min-height: 40px; }

.settings-card > .form-grid,
.settings-card > .form-group {
    margin-right: 28px;
    margin-left: 28px;
}

.settings-card > .btn-primary {
    margin: 4px 28px 28px;
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    font-weight: 800;
    cursor: pointer;
}

.analytics-page-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 22px;
    box-shadow: 0 14px 42px rgba(5,18,30,.14);
}

.analytics-page-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #F57C00, #ffb35c 38%, transparent 80%);
}

.analytics-page-card > .card-header {
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom-color: #e8edf3;
}

.analytics-page-card .reports-filter-panel {
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: inset 0 1px 0 white;
}

.analytics-page-card .quick-filter-btn {
    min-height: 36px;
    border-radius: 10px;
    transition: transform 180ms var(--motion-spring), border-color 180ms ease, background 180ms ease;
}

.analytics-page-card .quick-filter-btn:hover { transform: translateY(-2px); }
.analytics-page-card .report-buttons { gap: 14px; }
.analytics-page-card .btn-report { border-radius: 16px; }
.analytics-page-card .report-result { border-radius: 16px; }

@media (max-width: 768px) {
    .module-card { border-radius: 18px; }
    .module-card > .card-header {
        align-items: flex-start;
        padding: 22px 20px 18px;
    }
    .module-card > .module-toolbar,
    .module-card > .module-search,
    .module-card > .active-filter,
    .module-card > .module-filter-panel {
        margin-right: 20px;
        margin-left: 20px;
    }
    .module-card .table-wrapper { margin: 0 20px 20px; }
    .settings-card > .form-grid,
    .settings-card > .form-group { margin-right: 20px; margin-left: 20px; }
    .settings-card > .btn-primary { margin-right: 20px; margin-left: 20px; }
}

@media (max-width: 560px) {
    .module-card > .card-header { flex-direction: column; gap: 16px; }
    .module-card > .card-header .btn-add { width: 100%; justify-content: center; }
    .module-card > .module-toolbar,
    .module-card > .module-search,
    .module-card > .active-filter,
    .module-card > .module-filter-panel {
        margin-right: 14px;
        margin-left: 14px;
    }
    .module-card .table-wrapper { margin: 0 14px 14px; }
    .module-filter-panel { padding: 16px; }
    .module-filter-actions { flex-direction: column-reverse; }
    .module-filter-actions .btn-secondary, .module-filter-actions .btn-add { width: 100%; justify-content: center; }
    .settings-card > .form-grid,
    .settings-card > .form-group { margin-right: 14px; margin-left: 14px; }
    .settings-card > .btn-primary { width: calc(100% - 28px); margin: 4px 14px 20px; }
    .analytics-page-card { padding: 20px 16px; border-radius: 18px; }
    .analytics-page-card > .card-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    .analytics-page-card > .card-header .btn-export { width: 100%; justify-content: center; }
}

/* ==================== FINAL VISUAL POLISH ==================== */
::selection { background: rgba(245,124,0,.24); color: #0B1C2D; }

* { scrollbar-color: #94a3b8 transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #94a3b8; border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #64748b; background-clip: padding-box; }

.form-label, .toolbar-label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .25px;
}

.form-input, .form-select, .form-textarea, .search-input {
    min-height: 44px;
    border-width: 1px;
    border-color: #cfd9e4;
    background-color: #fbfcfe;
    color: #0B1C2D;
}

.form-input:hover, .form-select:hover, .form-textarea:hover, .search-input:hover {
    border-color: #aebdcc;
    background-color: #fff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus, .search-input:focus {
    border-color: #F57C00;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(245,124,0,.11);
}

input::placeholder, textarea::placeholder { color: #94a3b8; opacity: 1; }

.modal {
    padding: 24px;
    background: rgba(3,12,22,.72);
    backdrop-filter: blur(10px) saturate(.85);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(700px, 100%);
    max-height: min(90vh, 860px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 24px;
    box-shadow: 0 34px 90px rgba(0,0,0,.38);
}

.modal-content::before {
    content: '';
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #F57C00, #ffb35c 42%, transparent 82%);
}

.modal-wide { width: min(960px, 100%); }

.modal-header {
    flex: 0 0 auto;
    padding: 22px 26px 19px;
    border-bottom: 1px solid #e5ebf1;
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.modal-title {
    color: #0B1C2D;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.4px;
}

.modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #64748b;
}

.modal-close:hover { border-color: #fecaca; background: #fef2f2; color: #b91c1c; transform: rotate(4deg); }

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 26px;
    background: #fff;
}

.modal-footer {
    flex: 0 0 auto;
    padding: 17px 26px;
    border-top: 1px solid #e5ebf1;
    background: #f8fafc;
}

.modal-footer .btn-add, .modal-footer .btn-primary, .modal-footer .btn-secondary {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 11px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    line-height: 1;
    text-align: center;
    border: 1px solid #d8e0e8;
    background: #fff;
    color: #334155;
    font-family: var(--font-ui);
}
.btn-secondary:hover { border-color: #b9c5d1; background: #f1f5f9; color: #0B1C2D; }

.empty-state {
    display: flex;
    min-height: 190px;
    padding: 36px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.empty-icon {
    display: inline-flex;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc, #fff7ed);
    color: #F57C00;
    font-size: 23px;
    opacity: 1;
    box-shadow: 0 10px 24px rgba(11,28,45,.07);
}

.empty-text { color: #475569; font-size: 14px; font-weight: 700; line-height: 1.5; }

.status-badge {
    border: 1px solid transparent;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15px;
}

.status-success { border-color: #a7f3d0; }
.status-warning { border-color: #fde68a; }
.status-danger { border-color: #fecaca; }
.status-info { border-color: #bfdbfe; }

.btn-action {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 9px;
}

.btn-edit { border-color: #bfdbfe; }
.btn-delete { border-color: #fecaca; }
.btn-view, .btn-restore { border-color: #a7f3d0; }
.btn-info { border-color: #bae6fd; }

.alert {
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 7px 18px rgba(11,28,45,.05);
}

.table-wrapper { scrollbar-gutter: stable; }
.table-wrapper:focus-within { border-color: rgba(245,124,0,.42); }

.report-result {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}

@media (max-width: 600px) {
    .modal { align-items: flex-end; padding: 0; }
    .modal-content, .modal-wide {
        width: 100%;
        max-height: 94vh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 22px 22px 0 0;
    }
    .modal-header { padding: 20px 18px 16px; }
    .modal-title { font-size: 19px; }
    .modal-body { padding: 20px 18px; }
    .modal-footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .form-group { margin-bottom: 16px; }
}

@media (max-width: 430px) {
    .modal-footer { flex-direction: column-reverse; }
    .modal-footer > button { width: 100%; justify-content: center; }
    .empty-state { min-height: 160px; padding: 28px 16px; }
}

/* ==================== DISPATCH AND RETURN ==================== */
.btn-dispatch { border-color: #fed7aa; background: #ffedd5; color: #c2410c; }
.btn-dispatch:hover { background: #F57C00; color: #fff; }
.btn-return { border-color: #c4b5fd; background: #ede9fe; color: #6d28d9; }
.btn-return:hover { background: #7c3aed; color: #fff; }

.reservation-operation-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 15px;
    background: #fff7ed;
}

.reservation-operation-notice > i { display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 12px; background: #F57C00; color: #fff; }
.reservation-operation-notice strong { display: block; margin-bottom: 4px; color: #9a3412; font-size: 14px; }
.reservation-operation-notice p { color: #9a5a2c; font-size: 12px; line-height: 1.5; }
.reservation-operation-notice.return { border-color: #bfdbfe; background: #eff6ff; }
.reservation-operation-notice.return > i { background: #2563eb; }
.reservation-operation-notice.return strong { color: #1e40af; }
.reservation-operation-notice.return p { color: #475569; }

.reservation-operation-items { overflow: hidden; margin-bottom: 18px; border: 1px solid #e2e8f0; border-radius: 15px; }
.reservation-operation-item { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid #edf2f7; }
.reservation-operation-item:last-child { border-bottom: 0; }
.reservation-operation-item > i { display: flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 9px; background: #dcfce7; color: #15803d; font-size: 12px; }
.reservation-operation-item strong { display: block; color: #0B1C2D; font-size: 13px; }
.reservation-operation-item span { display: block; margin-top: 3px; color: #64748b; font-size: 11px; }
.reservation-operation-item b { color: #F57C00; font-size: 18px; }
.reservation-operation-notes { margin: 0; }

.reservation-return-header,
.reservation-return-row {
    display: grid;
    grid-template-columns: minmax(210px,1.4fr) repeat(3,minmax(88px,.55fr)) minmax(90px,.5fr);
    gap: 10px;
    align-items: center;
}

.reservation-return-header { padding: 0 13px 8px; color: #64748b; font-size: 10px; font-weight: 900; letter-spacing: .3px; text-transform: uppercase; }
.reservation-return-items { display: grid; gap: 9px; }
.reservation-return-row { padding: 12px; border: 1px solid #dce4ed; border-radius: 14px; background: #f8fafc; }
.reservation-return-material { min-width: 0; }
.reservation-return-material strong { display: block; overflow: hidden; color: #0B1C2D; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.reservation-return-material span { display: block; margin-top: 4px; color: #64748b; font-size: 10px; }
.reservation-return-row label > span { display: none; }
.reservation-return-row input { min-width: 0; padding: 10px; text-align: center; }
.reservation-return-check { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font-size: 11px; font-weight: 800; }
.reservation-return-check.valid { border: 1px solid #a7f3d0; background: #ecfdf5; color: #047857; }
.reservation-return-check.invalid { border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; }

.reservation-return-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.reservation-return-summary > div { padding: 13px 15px; border: 1px solid #a7f3d0; border-radius: 13px; background: #ecfdf5; }
.reservation-return-summary span { display: block; margin-bottom: 4px; color: #047857; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.reservation-return-summary strong { color: #065f46; font-size: 21px; }
.reservation-return-summary .damaged { border-color: #fde68a; background: #fffbeb; }
.reservation-return-summary .damaged span, .reservation-return-summary .damaged strong { color: #92400e; }
.reservation-return-summary .lost { border-color: #fecaca; background: #fef2f2; }
.reservation-return-summary .lost span, .reservation-return-summary .lost strong { color: #991b1b; }
#btnConfirmarDevolucao:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

html[data-theme='dark'] .btn-dispatch { border-color: #74451f; background: #30251d; color: #fdba74; }
html[data-theme='dark'] .btn-return { border-color: #55438c; background: #292440; color: #c4b5fd; }
html[data-theme='dark'] .reservation-operation-notice { border-color: #70451f; background: #2c241d; }
html[data-theme='dark'] .reservation-operation-notice strong { color: #fdba74; }
html[data-theme='dark'] .reservation-operation-notice p { color: #d6b08b; }
html[data-theme='dark'] .reservation-operation-notice.return { border-color: #315276; background: #17283a; }
html[data-theme='dark'] .reservation-operation-notice.return strong { color: #93c5fd; }
html[data-theme='dark'] .reservation-operation-notice.return p { color: #aebed0; }
html[data-theme='dark'] .reservation-operation-items,
html[data-theme='dark'] .reservation-return-row { border-color: #2d4254; background: #142433; }
html[data-theme='dark'] .reservation-operation-item { border-bottom-color: #293d4e; }
html[data-theme='dark'] .reservation-operation-item strong,
html[data-theme='dark'] .reservation-return-material strong { color: #f8fafc; }
html[data-theme='dark'] .reservation-operation-item span,
html[data-theme='dark'] .reservation-return-material span,
html[data-theme='dark'] .reservation-return-header { color: #9fb0c3; }
html[data-theme='dark'] .reservation-return-check.valid { border-color: #276749; background: #173127; color: #6ee7b7; }
html[data-theme='dark'] .reservation-return-check.invalid { border-color: #71343a; background: #321d24; color: #fca5a5; }
html[data-theme='dark'] .reservation-return-summary > div { border-color: #276749; background: #173127; }
html[data-theme='dark'] .reservation-return-summary .damaged { border-color: #715726; background: #30291a; }
html[data-theme='dark'] .reservation-return-summary .lost { border-color: #71343a; background: #321d24; }

@media (max-width: 760px) {
    .reservation-return-header { display: none; }
    .reservation-return-row { grid-template-columns: repeat(3,minmax(0,1fr)) 76px; align-items: end; }
    .reservation-return-material { grid-column: 1 / -1; padding-bottom: 5px; border-bottom: 1px solid #e2e8f0; }
    .reservation-return-row label > span { display: block; margin-bottom: 5px; color: #64748b; font-size: 9px; font-weight: 900; text-transform: uppercase; }
    html[data-theme='dark'] .reservation-return-material { border-bottom-color: #2d4254; }
    html[data-theme='dark'] .reservation-return-row label > span { color: #9fb0c3; }
}

@media (max-width: 480px) {
    .reservation-operation-notice { flex-direction: column; }
    .reservation-return-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .reservation-return-check { grid-column: 1 / -1; }
    .reservation-return-summary { grid-template-columns: 1fr; }
}

/* Mantem o autofill coerente com os campos do sistema. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #0B1C2D;
    box-shadow: 0 0 0 1000px #fbfcfe inset;
    caret-color: #0B1C2D;
    transition: background-color 9999s ease-out;
}

html[data-theme='dark'] input:-webkit-autofill,
html[data-theme='dark'] input:-webkit-autofill:hover,
html[data-theme='dark'] input:-webkit-autofill:focus,
html[data-theme='dark'] textarea:-webkit-autofill,
html[data-theme='dark'] select:-webkit-autofill {
    -webkit-text-fill-color: #f8fafc;
    box-shadow: 0 0 0 1000px #0c1b28 inset;
    caret-color: #fb923c;
}

/* ==================== INVENTORY ==================== */
.inventory-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.inventory-summary-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(11,28,45,.07);
}

.inventory-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.inventory-summary-card strong {
    color: #0B1C2D;
    font-size: 32px;
    line-height: 1;
}

.inventory-summary-card.counting { border-color: #fed7aa; }
.inventory-summary-card.approval { border-color: #fde68a; }
.inventory-summary-card.divergence { border-color: #fecaca; }
.inventory-filters .form-input,
.inventory-filters .form-select,
.inventory-filters .reservation-clear-filter {
    height: 50px;
    min-height: 50px;
}
.inventory-filters .reservation-clear-filter {
    align-self: end;
    padding-block: 0;
}
.inventory-search-group { min-width: min(380px, 100%); flex: 1; }

.inventory-progress {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}

.inventory-progress > div {
    overflow: hidden;
    height: 9px;
    border-radius: 99px;
    background: #e2e8f0;
}

.inventory-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #F57C00, #10b981);
}

.inventory-progress strong {
    color: #475569;
    font-size: 12px;
}

.inventory-divergence {
    display: inline-flex;
    min-width: 34px;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 900;
}

.inventory-divergence.has-divergence {
    background: #fff7ed;
    color: #c2410c;
}

.inventory-detail-items {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.inventory-detail-items h5 {
    margin: 0 0 4px;
    color: #0B1C2D;
    font-size: 15px;
}

.inventory-detail-item {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(78px, .45fr));
    gap: 10px;
    align-items: center;
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.inventory-detail-item.ok { border-color: #a7f3d0; background: #ecfdf5; }
.inventory-detail-item.alert { border-color: #fed7aa; background: #fff7ed; }
.inventory-detail-item strong { display: block; color: #0B1C2D; font-size: 13px; }
.inventory-detail-item span { display: block; color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.inventory-detail-item > div:first-child span { margin-top: 4px; font-weight: 500; text-transform: none; }
.inventory-detail-item b { color: #0B1C2D; font-size: 16px; }

.inventory-count-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.inventory-count-toolbar .form-input { flex: 1; margin: 0; }

.inventory-count-header,
.inventory-count-row {
    display: grid;
    grid-template-columns: minmax(230px,1.35fr) minmax(80px,.4fr) minmax(100px,.45fr) minmax(105px,.45fr) minmax(92px,.4fr) minmax(150px,.7fr);
    gap: 10px;
    align-items: center;
}

.inventory-count-header {
    padding: 0 12px 8px;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.inventory-count-items {
    display: grid;
    gap: 9px;
    max-height: min(58vh, 620px);
    overflow: auto;
    padding-right: 4px;
}

.inventory-count-row {
    padding: 12px;
    border: 1px solid #dce4ed;
    border-radius: 14px;
    background: #f8fafc;
}

.inventory-count-material { min-width: 0; }
.inventory-count-material strong {
    display: block;
    overflow: hidden;
    color: #0B1C2D;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-count-material span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
}

.inventory-count-expected {
    color: #0B1C2D;
    font-size: 18px;
    font-weight: 900;
}

.inventory-count-row label > span { display: none; }
.inventory-count-row input { min-width: 0; padding: 10px; }
.inventory-counted,
.inventory-damaged { text-align: center; }

.inventory-count-diff {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eef2f7;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.inventory-count-diff.ok {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.inventory-count-diff.alert {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

html[data-theme='dark'] .inventory-summary-card,
html[data-theme='dark'] .inventory-detail-item,
html[data-theme='dark'] .inventory-count-row {
    border-color: #2d4254;
    background: #102131;
}

html[data-theme='dark'] .inventory-summary-card strong,
html[data-theme='dark'] .inventory-detail-items h5,
html[data-theme='dark'] .inventory-detail-item strong,
html[data-theme='dark'] .inventory-detail-item b,
html[data-theme='dark'] .inventory-count-material strong,
html[data-theme='dark'] .inventory-count-expected {
    color: #f8fafc;
}

html[data-theme='dark'] .inventory-summary-card span,
html[data-theme='dark'] .inventory-detail-item span,
html[data-theme='dark'] .inventory-count-header,
html[data-theme='dark'] .inventory-count-material span,
html[data-theme='dark'] .inventory-progress strong {
    color: #9fb0c3;
}

html[data-theme='dark'] .inventory-progress > div,
html[data-theme='dark'] .inventory-count-diff {
    background: #203244;
}

html[data-theme='dark'] .inventory-divergence,
html[data-theme='dark'] .inventory-count-diff.ok,
html[data-theme='dark'] .inventory-detail-item.ok {
    border-color: #276749;
    background: #173127;
    color: #6ee7b7;
}

html[data-theme='dark'] .inventory-divergence.has-divergence,
html[data-theme='dark'] .inventory-count-diff.alert,
html[data-theme='dark'] .inventory-detail-item.alert {
    border-color: #70451f;
    background: #2c241d;
    color: #fdba74;
}

@media (max-width: 1100px) {
    .inventory-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inventory-count-header { display: none; }
    .inventory-count-row { grid-template-columns: repeat(4, minmax(0,1fr)); align-items: end; }
    .inventory-count-material { grid-column: 1 / -1; padding-bottom: 5px; border-bottom: 1px solid #e2e8f0; }
    .inventory-note { grid-column: 1 / -1; }
    .inventory-count-row label > span { display: block; margin-bottom: 5px; color: #64748b; font-size: 9px; font-weight: 900; text-transform: uppercase; }
    html[data-theme='dark'] .inventory-count-material { border-bottom-color: #2d4254; }
}

@media (max-width: 760px) {
    .inventory-summary-grid { grid-template-columns: 1fr; }
    .inventory-count-toolbar { flex-direction: column; align-items: stretch; }
    .inventory-count-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .inventory-detail-item { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .inventory-detail-item > div:first-child { grid-column: 1 / -1; }
}

input:autofill, textarea:autofill, select:autofill {
    color: #0B1C2D;
    background: #fbfcfe;
}

html[data-theme='dark'] input:autofill,
html[data-theme='dark'] textarea:autofill,
html[data-theme='dark'] select:autofill {
    color: #f8fafc;
    background: #0c1b28;
}

/* ==================== MATERIAL MAINTENANCE ==================== */
.report-stat-card::before { display: none; }
.btn-maintenance { border-color: #fde68a; background: #fef3c7; color: #92400e; }
.btn-maintenance:hover { background: #d97706; color: #fff; }
#materiaisTable th.actions-column, #materiaisTable td.actions-column { width: 200px; min-width: 200px; }
.material-detail-card.danger { border-color: #fecaca; background: #fef2f2; }
.material-detail-card.danger span, .material-detail-card.danger strong { color: #991b1b; }

.maintenance-material-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 17px 18px; border: 1px solid #dce4ed; border-radius: 16px; background: #f8fafc; }
.maintenance-material-summary > div:first-child span { display: block; margin-bottom: 4px; color: #F57C00; font-size: 10px; font-weight: 900; letter-spacing: .8px; }
.maintenance-material-summary > div:first-child strong { color: #0B1C2D; font-size: 18px; }
.maintenance-balance { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.maintenance-balance span { padding: 7px 10px; border-radius: 10px; background: #fff; color: #64748b; font-size: 11px; font-weight: 700; }
.maintenance-balance b { color: #0B1C2D; }
.maintenance-balance .damaged { background: #fef2f2; color: #b91c1c; }
.maintenance-balance .damaged b { color: #b91c1c; }

.maintenance-action-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.maintenance-action-tabs button { display: flex; min-height: 74px; padding: 12px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid #dce4ed; border-radius: 14px; background: #fff; color: #64748b; cursor: pointer; font-family: var(--font-ui); font-weight: 800; }
.maintenance-action-tabs button i { font-size: 19px; }
.maintenance-action-tabs button:hover { border-color: #fdba74; color: #c2410c; }
.maintenance-action-tabs button.active { border-color: #F57C00; background: #fff7ed; color: #c2410c; box-shadow: 0 8px 20px rgba(245,124,0,.1); }

.maintenance-form-panel { padding: 18px; border: 1px solid #dce4ed; border-radius: 16px; background: #fbfcfe; }
.maintenance-impact { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 11px 13px; border-radius: 11px; background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 700; }
.maintenance-impact i { color: #F57C00; }
.maintenance-impact.repair { background: #ecfdf5; color: #047857; }
.maintenance-impact.repair i { color: #10b981; }
.maintenance-impact.discard { background: #fef2f2; color: #991b1b; }
.maintenance-impact.discard i { color: #dc2626; }
.maintenance-form-panel .form-grid { grid-template-columns: 140px 180px minmax(220px,1fr); margin-bottom: 0; }
.maintenance-form-panel .form-group:last-child { margin-bottom: 0; }

.maintenance-history { margin-top: 20px; }
.maintenance-history h4 { margin-bottom: 10px; color: #0B1C2D; font-size: 14px; }
.maintenance-history > div { display: grid; gap: 8px; }
.maintenance-history-item { display: grid; grid-template-columns: 82px minmax(180px,.8fr) minmax(220px,1fr); align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid #e2e8f0; border-radius: 12px; }
.maintenance-history-item strong { display: block; color: #0B1C2D; font-size: 12px; }
.maintenance-history-item small { display: block; margin-top: 3px; color: #64748b; font-size: 10px; }
.maintenance-history-item p { color: #64748b; font-size: 11px; }

html[data-theme='dark'] .btn-maintenance { border-color: #715726; background: #30291a; color: #fde68a; }
html[data-theme='dark'] .material-detail-card.danger { border-color: #71343a; background: #321d24; }
html[data-theme='dark'] .material-detail-card.danger span, html[data-theme='dark'] .material-detail-card.danger strong { color: #fca5a5; }
html[data-theme='dark'] .maintenance-material-summary,
html[data-theme='dark'] .maintenance-form-panel,
html[data-theme='dark'] .maintenance-history-item { border-color: #2d4254; background: #142433; }
html[data-theme='dark'] .maintenance-material-summary > div:first-child strong,
html[data-theme='dark'] .maintenance-balance b,
html[data-theme='dark'] .maintenance-history h4,
html[data-theme='dark'] .maintenance-history-item strong { color: #f8fafc; }
html[data-theme='dark'] .maintenance-balance span { background: #0c1b28; color: #9fb0c3; }
html[data-theme='dark'] .maintenance-balance .damaged { background: #321d24; color: #fca5a5; }
html[data-theme='dark'] .maintenance-balance .damaged b { color: #fca5a5; }
html[data-theme='dark'] .maintenance-action-tabs button { border-color: #34495a; background: #142433; color: #9fb0c3; }
html[data-theme='dark'] .maintenance-action-tabs button.active { border-color: #F57C00; background: #2d241d; color: #fdba74; }
html[data-theme='dark'] .maintenance-impact { background: #2d241d; color: #fdba74; }
html[data-theme='dark'] .maintenance-impact.repair { background: #173127; color: #6ee7b7; }
html[data-theme='dark'] .maintenance-impact.discard { background: #321d24; color: #fca5a5; }
html[data-theme='dark'] .maintenance-history-item small, html[data-theme='dark'] .maintenance-history-item p { color: #9fb0c3; }

@media (max-width: 760px) {
    .maintenance-material-summary { align-items: flex-start; flex-direction: column; }
    .maintenance-balance { justify-content: flex-start; }
    .maintenance-form-panel .form-grid { grid-template-columns: 1fr; }
    .maintenance-history-item { grid-template-columns: 78px 1fr; }
    .maintenance-history-item p { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .maintenance-action-tabs { grid-template-columns: 1fr; }
    .maintenance-action-tabs button { min-height: 50px; flex-direction: row; }
}

/* ==================== DAMAGES AND LOSSES ==================== */
.damage-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.damage-summary-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(11,28,45,.07);
}

.damage-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.damage-summary-card strong {
    color: #0B1C2D;
    font-size: 28px;
    line-height: 1.1;
}

.damage-summary-card.danger { border-color: #fecaca; }
.damage-summary-card.warning { border-color: #fed7aa; }
.damage-summary-card.success { border-color: #a7f3d0; }
.damage-summary-card.loss { border-color: #fde68a; }

.damage-tabs {
    display: inline-flex;
    width: fit-content;
    gap: 6px;
    margin: 24px 28px 18px;
    padding: 5px;
    border: 1px solid #dbe3ec;
    border-radius: 15px;
    background: #f8fafc;
}

.damage-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 15px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 900;
}

.damage-tabs button.active {
    background: #fff;
    color: #c2410c;
    box-shadow: 0 8px 18px rgba(11,28,45,.08);
}

.damage-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 310px) auto;
    gap: 14px;
    align-items: end;
    margin: 0 28px 22px;
    padding: 18px;
}

.damage-filters .form-group { margin: 0; }

.damage-filters .reservation-clear-filter {
    width: auto;
    min-width: 116px;
    height: 49px;
    margin: 0;
    white-space: nowrap;
}

.damage-search-group { flex: 1; min-width: min(420px, 100%); }
.damage-quantity {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 900;
}

.damage-page-card .table-secondary {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
}

html[data-theme='dark'] .damage-summary-card,
html[data-theme='dark'] .damage-tabs {
    border-color: #2d4254;
    background: #102131;
}

html[data-theme='dark'] .damage-filters {
    border-color: #2d4254;
    background: #102131;
}

html[data-theme='dark'] .damage-summary-card strong {
    color: #f8fafc;
}

html[data-theme='dark'] .damage-summary-card span,
html[data-theme='dark'] .damage-page-card .table-secondary {
    color: #9fb0c3;
}

html[data-theme='dark'] .damage-tabs button {
    color: #9fb0c3;
}

html[data-theme='dark'] .damage-tabs button.active {
    background: #182a39;
    color: #fdba74;
}

html[data-theme='dark'] .damage-quantity {
    background: #321d24;
    color: #fca5a5;
}

@media (max-width: 1100px) {
    .damage-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .damage-summary-grid { grid-template-columns: 1fr; }
    .damage-tabs { display: grid; grid-template-columns: 1fr; margin: 18px; }
    .damage-tabs button { width: 100%; }
    .damage-filters { grid-template-columns: 1fr; margin: 0 18px 18px; }
    .damage-filters .reservation-clear-filter { width: 100%; }
}

/* ==================== LIGHT/DARK THEME ==================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid #dbe3ec;
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: pointer;
    font-size: 16px;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--motion-spring);
}

.theme-toggle:hover { border-color: #fdba74; background: #fff7ed; color: #F57C00; transform: translateY(-2px); }

html[data-theme='dark'] body {
    background: radial-gradient(circle at 75% 0%, #19364c 0%, transparent 34%), linear-gradient(135deg, #06111c 0%, #0a1a28 48%, #10283a 100%);
    color: #dbe5ef;
}

html[data-theme='dark'] .sidebar { background: rgba(5,16,26,.97); border-right-color: rgba(148,163,184,.14); }
html[data-theme='dark'] .page-header,
html[data-theme='dark'] .card,
html[data-theme='dark'] .metric-card,
html[data-theme='dark'] .dashboard-panel,
html[data-theme='dark'] .stat-card,
html[data-theme='dark'] .module-card,
html[data-theme='dark'] .analytics-page-card,
html[data-theme='dark'] .login-container {
    border-color: #293d4e;
    background: #10202e;
    box-shadow: 0 16px 44px rgba(0,0,0,.25);
}

html[data-theme='dark'] .page-header { background: rgba(16,32,46,.96); }
html[data-theme='dark'] .module-card > .card-header,
html[data-theme='dark'] .modal-header,
html[data-theme='dark'] .notification-panel-header {
    border-color: #293d4e;
    background: linear-gradient(180deg, #142635, #10202e);
}

html[data-theme='dark'] .page-title,
html[data-theme='dark'] .user-name,
html[data-theme='dark'] .card-title,
html[data-theme='dark'] .module-header-copy .card-title,
html[data-theme='dark'] .panel-title,
html[data-theme='dark'] .metric-value,
html[data-theme='dark'] .metric-note span,
html[data-theme='dark'] .stat-value,
html[data-theme='dark'] .insight-title,
html[data-theme='dark'] .insight-value,
html[data-theme='dark'] .report-title,
html[data-theme='dark'] .report-result-title,
html[data-theme='dark'] .modal-title,
html[data-theme='dark'] .notification-panel-header strong,
html[data-theme='dark'] .notification-item-title,
html[data-theme='dark'] .empty-text,
html[data-theme='dark'] .material-details-main h4,
html[data-theme='dark'] .log-diff-card h4,
html[data-theme='dark'] .login-title {
    color: #f8fafc;
}

html[data-theme='dark'] .module-header-copy p,
html[data-theme='dark'] .card-subtitle,
html[data-theme='dark'] .panel-subtitle,
html[data-theme='dark'] .metric-label,
html[data-theme='dark'] .metric-note,
html[data-theme='dark'] .insight-meta,
html[data-theme='dark'] .notification-panel-header span,
html[data-theme='dark'] .notification-item-message,
html[data-theme='dark'] .empty-state,
html[data-theme='dark'] .health-meta {
    color: #9fb0c3;
}

html[data-theme='dark'] .user-actions { border-left-color: #314557; }
html[data-theme='dark'] .theme-toggle,
html[data-theme='dark'] .notification-button {
    border-color: #34495a;
    background: #152838;
    color: #d9e3ed;
}

html[data-theme='dark'] .theme-toggle:hover,
html[data-theme='dark'] .notification-button:hover,
html[data-theme='dark'] .notification-button[aria-expanded='true'] {
    border-color: #F57C00;
    background: #2b241e;
    color: #fb923c;
}

html[data-theme='dark'] .btn-logout { border-color: #fb923c; color: #fb923c; }
html[data-theme='dark'] .btn-logout:hover { background: #F57C00; color: #fff; }

html[data-theme='dark'] .module-filter-panel,
html[data-theme='dark'] .reports-filter-panel,
html[data-theme='dark'] .insight-item,
html[data-theme='dark'] .empty-compact,
html[data-theme='dark'] .material-details-main,
html[data-theme='dark'] .material-details-photo,
html[data-theme='dark'] .material-details-grid > div,
html[data-theme='dark'] .log-summary-grid > div,
html[data-theme='dark'] .log-diff-card,
html[data-theme='dark'] .report-result {
    border-color: #2d4254;
    background: #142433;
    color: #dbe5ef;
}

html[data-theme='dark'] .insight-item.warning { border-color: #69462b; background: #2d241d; }

html[data-theme='dark'] .report-table-wrapper {
    border-color: #345066;
    background: #10202e;
}

html[data-theme='dark'] .form-label,
html[data-theme='dark'] .toolbar-label { color: #b5c3d1; }

html[data-theme='dark'] .form-input,
html[data-theme='dark'] .form-select,
html[data-theme='dark'] .form-textarea,
html[data-theme='dark'] .search-input {
    border-color: #34495a;
    background-color: #0c1b28;
    color: #f1f5f9;
}

html[data-theme='dark'] .form-input:hover,
html[data-theme='dark'] .form-select:hover,
html[data-theme='dark'] .form-textarea:hover,
html[data-theme='dark'] .search-input:hover,
html[data-theme='dark'] .form-input:focus,
html[data-theme='dark'] .form-select:focus,
html[data-theme='dark'] .form-textarea:focus,
html[data-theme='dark'] .search-input:focus {
    border-color: #F57C00;
    background-color: #102332;
}

html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder { color: #718398; }

html[data-theme='dark'] table,
html[data-theme='dark'] .table-wrapper { border-color: #2d4254; background: #10202e; }
html[data-theme='dark'] td { border-bottom-color: #263b4c; color: #dbe5ef; }
html[data-theme='dark'] tbody tr:nth-child(even),
html[data-theme='dark'] .module-card tbody tr:nth-child(even),
html[data-theme='dark'] .row-muted { background: #122331; }
html[data-theme='dark'] tbody tr:hover { background: #192d3d; }

html[data-theme='dark'] .notification-panel {
    border-color: #34495a;
    background: #10202e;
    box-shadow: 0 24px 65px rgba(0,0,0,.48);
}

html[data-theme='dark'] .notification-list { background: #0d1c29; }
html[data-theme='dark'] .notification-item:hover { background: #1a2d3d; }
html[data-theme='dark'] .notification-item.unread { background: #29231f; }
html[data-theme='dark'] .notification-item.unread:hover { background: #34291f; }

html[data-theme='dark'] .modal-content { border-color: #34495a; background: #10202e; }
html[data-theme='dark'] .modal-body { background: #10202e; }
html[data-theme='dark'] .modal-footer { border-color: #293d4e; background: #0c1b28; }
html[data-theme='dark'] .modal-close { border-color: #34495a; background: #182b3a; color: #b8c5d2; }
html[data-theme='dark'] .modal-close:hover { border-color: #7f1d1d; background: #381d22; color: #fca5a5; }

html[data-theme='dark'] .btn-secondary { border-color: #3a4e5f; background: #182a39; color: #dbe5ef; }
html[data-theme='dark'] .btn-secondary:hover { border-color: #54697a; background: #203545; color: #fff; }

html[data-theme='dark'] .btn-report { border-color: #304657; background: #142433; }
html[data-theme='dark'] .btn-report:hover { border-color: #F57C00; background: #192b3a; }
html[data-theme='dark'] .btn-report.active { border-color: #F57C00; background: #2d241d; }
html[data-theme='dark'] .report-desc { color: #9fb0c3; }

html[data-theme='dark'] .chart-toggle { border-color: #34495a; background: #0c1b28; }
html[data-theme='dark'] .chart-toggle-btn { color: #b9c7d4; }
html[data-theme='dark'] .chart-toggle-btn:hover { background: #1c3040; color: #fff; }
html[data-theme='dark'] .chart-toggle-btn.active { background: #F57C00; color: #fff; }

html[data-theme='dark'] .dashboard-link { background: rgba(245,124,0,.14); color: #fdba74; }
html[data-theme='dark'] .dashboard-link:hover { border-color: #9a5a25; background: rgba(245,124,0,.22); color: #fed7aa; }

html[data-theme='dark'] .empty-icon { border-color: #34495a; background: linear-gradient(135deg, #172a39, #2b241e); }
html[data-theme='dark'] .search-icon { color: #718398; }
html[data-theme='dark'] .active-filter { border-color: #6d4728; background: #2b241e; color: #fdba74; }
html[data-theme='dark'] .quick-filter-btn { border-color: #34495a; background: #142433; color: #cbd5e1; }
html[data-theme='dark'] .quick-filter-btn:hover { border-color: #F57C00; color: #fdba74; }

.login-wrapper { position: relative; }
.login-theme-toggle {
    position: fixed;
    z-index: 10;
    top: 22px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-color: rgba(255,255,255,.22);
    background: rgba(255,255,255,.1);
    color: #fff;
    backdrop-filter: blur(12px);
}

.login-theme-toggle:hover { border-color: #fdba74; background: rgba(245,124,0,.18); }

html[data-theme='dark'] .login-wrapper {
    background: radial-gradient(circle at 50% 18%, rgba(42,93,126,.34), transparent 32%);
}

html[data-theme='dark'] .login-container {
    position: relative;
    border: 1px solid #2a4052;
    background: linear-gradient(160deg, #132635 0%, #0d1c29 100%);
    box-shadow: 0 30px 85px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.04);
}

html[data-theme='dark'] .login-container::before {
    content: '';
    position: absolute;
    top: 0;
    right: 42px;
    left: 42px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(245,124,0,.75), transparent);
}

html[data-theme='dark'] .login-header { margin-bottom: 34px; }
html[data-theme='dark'] .login-logo { box-shadow: 0 16px 36px rgba(245,124,0,.25); }
html[data-theme='dark'] .login-subtitle { color: #fb923c; }
html[data-theme='dark'] .login-container .form-label { color: #c8d4df; }
html[data-theme='dark'] .login-container .form-input {
    border-color: #365065;
    background: #102737;
    color: #f8fafc;
    caret-color: #fb923c;
}

html[data-theme='dark'] .login-container .form-input:focus {
    border-color: #F57C00;
    background: #132d3e;
    box-shadow: 0 0 0 4px rgba(245,124,0,.14);
}

.login-container input:-webkit-autofill,
.login-container input:-webkit-autofill:hover,
.login-container input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0B1C2D;
    box-shadow: 0 0 0 1000px #fbfcfe inset;
    transition: background-color 9999s ease-out;
}

html[data-theme='dark'] .login-container input:-webkit-autofill,
html[data-theme='dark'] .login-container input:-webkit-autofill:hover,
html[data-theme='dark'] .login-container input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc;
    box-shadow: 0 0 0 1000px #102737 inset;
    caret-color: #fb923c;
}

@media (max-width: 520px) {
    .login-theme-toggle { top: 14px; right: 14px; }
    .login-container { padding: 38px 26px; }
}

@media (max-width: 480px) {
    .theme-toggle { width: 40px; height: 40px; }
}

/* ==================== RESERVATIONS ==================== */
.reservation-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.reservation-summary-card {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(5,18,30,.1);
}

.reservation-summary-card::after { display: none; }
.reservation-summary-card span { display: block; margin-bottom: 7px; color: #64748b; font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.reservation-summary-card strong { color: #0B1C2D; font-size: 27px; line-height: 1; }

.reservation-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(180px, .7fr) auto;
    gap: 14px;
    align-items: end;
    margin: 0 28px 24px;
    padding: 18px;
    border: 1px solid #dce4ed;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc, #fff);
}

.reservation-filters .form-group { margin: 0; }
.reservation-clear-filter { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.reservation-page-card th.actions-column, .reservation-page-card td.actions-column { width: 174px; min-width: 174px; }
.table-secondary { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; font-weight: 700; }
.table-date-arrow { margin: 0 4px; color: #F57C00; }
.btn-confirm { border-color: #bbf7d0; background: #dcfce7; color: #166534; }
.btn-confirm:hover { background: #16a34a; color: #fff; }

.form-help { display: block; margin-top: 6px; color: #64748b; font-size: 11px; line-height: 1.4; }
.reservation-items-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.reservation-items-heading .form-label { margin-bottom: 0; }
.reservation-items-heading .btn-secondary { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; white-space: nowrap; }
.reservation-items { display: grid; gap: 10px; }
.reservation-item-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 120px 42px;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid #dce4ed;
    border-radius: 14px;
    background: #f8fafc;
}

.reservation-material-field { min-width: 0; }
.reservation-quantity-field { min-width: 0; }
.reservation-quantity { padding-right: 10px; }
.reservation-quantity::-webkit-inner-spin-button { opacity: .55; }
.reservation-stock { display: block; margin-top: 6px; color: #64748b; font-size: 11px; font-weight: 700; }
.reservation-stock.available { color: #047857; }
.reservation-stock.warning { color: #c2410c; }
.reservation-remove-item { width: 42px; height: 44px; margin-top: 23px; border: 1px solid #fecaca; border-radius: 10px; background: #fef2f2; color: #b91c1c; cursor: pointer; }
.reservation-remove-item:hover { background: #dc2626; color: #fff; }

.reservation-detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px; border-radius: 18px; background: linear-gradient(135deg, #0B1C2D, #1b425d); color: #fff; }
.reservation-detail-code { display: block; margin-bottom: 7px; color: #fb923c; font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.reservation-detail-hero h4 { margin-bottom: 6px; font-size: 25px; }
.reservation-detail-hero p { color: #cbd5e1; font-size: 13px; }
.reservation-detail-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.reservation-detail-meta > div { padding: 14px; border: 1px solid #e2e8f0; border-radius: 13px; background: #f8fafc; }
.reservation-detail-meta span { display: block; margin-bottom: 5px; color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.reservation-detail-meta strong { color: #0B1C2D; font-size: 13px; overflow-wrap: anywhere; }
.reservation-timeline { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 10px; margin: 0 0 16px; }
.reservation-timeline-step { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #dce4ed; border-radius: 13px; background: #fff; }
.reservation-timeline-step > i { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; background: #fff3e8; color: #ea6a00; }
.reservation-timeline-step span { color: #334155; font-size: 11px; font-weight: 800; }
.reservation-timeline-step strong { display: block; margin-top: 3px; color: #64748b; font-size: 10px; font-weight: 600; }
.reservation-detail-items { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 15px; }
.reservation-detail-items h5 { padding: 13px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; color: #0B1C2D; font-size: 13px; }
.reservation-detail-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid #edf2f7; }
.reservation-detail-item:last-child { border-bottom: 0; }
.reservation-detail-item strong { display: block; color: #0B1C2D; font-size: 13px; }
.reservation-detail-item span { display: block; margin-top: 3px; color: #64748b; font-size: 11px; }
.reservation-detail-item b { min-width: 40px; color: #F57C00; font-size: 18px; text-align: right; }
.reservation-cancel-button, .reservation-danger-button { min-height: 42px; padding: 10px 18px; border: 1px solid #fecaca; border-radius: 11px; background: #dc2626; color: #fff; font-family: var(--font-ui); font-weight: 800; cursor: pointer; }
.reservation-action-modal { max-width: 480px; }
.reservation-action-modal .modal-body { text-align: center; }
.reservation-action-modal p { color: #475569; line-height: 1.6; }
.reservation-action-icon { display: flex; width: 62px; height: 62px; margin: 0 auto 16px; align-items: center; justify-content: center; border-radius: 18px; font-size: 25px; }
.reservation-action-icon.confirm { background: #dcfce7; color: #15803d; }
.reservation-action-icon.separate { background: #e0f2fe; color: #0369a1; }
.reservation-action-icon.deliver { background: #ffedd5; color: #c2410c; }
.reservation-action-icon.cancel { background: #fee2e2; color: #b91c1c; }
.reservation-action-password { margin: 18px 0 0; text-align: left; }

html[data-theme='dark'] .reservation-summary-card { border-color: #293d4e; background: #10202e; }
html[data-theme='dark'] .reservation-summary-card span { color: #9fb0c3; }
html[data-theme='dark'] .reservation-summary-card strong { color: #f8fafc; }
html[data-theme='dark'] .reservation-filters,
html[data-theme='dark'] .reservation-item-row,
html[data-theme='dark'] .reservation-detail-meta > div,
html[data-theme='dark'] .reservation-timeline-step,
html[data-theme='dark'] .reservation-detail-items,
html[data-theme='dark'] .reservation-detail-items h5 { border-color: #2d4254; background: #142433; }
html[data-theme='dark'] .form-help, html[data-theme='dark'] .reservation-stock { color: #8fa2b5; }
html[data-theme='dark'] .reservation-stock.available { color: #6ee7b7; }
html[data-theme='dark'] .reservation-stock.warning { color: #fdba74; }
html[data-theme='dark'] .reservation-remove-item { border-color: #71343a; background: #321d24; color: #fca5a5; }
html[data-theme='dark'] .reservation-remove-item:hover { border-color: #dc2626; background: #dc2626; color: #fff; }
html[data-theme='dark'] .reservation-detail-meta span, html[data-theme='dark'] .reservation-detail-item span { color: #9fb0c3; }
html[data-theme='dark'] .reservation-detail-meta strong, html[data-theme='dark'] .reservation-detail-items h5, html[data-theme='dark'] .reservation-detail-item strong { color: #f8fafc; }
html[data-theme='dark'] .reservation-detail-item { border-bottom-color: #293d4e; }
html[data-theme='dark'] .reservation-action-modal p { color: #b7c5d2; }
html[data-theme='dark'] .reservation-timeline-step { border-color: #2d4254; background: #142433; }
html[data-theme='dark'] .reservation-timeline-step span { color: #e2e8f0; }
html[data-theme='dark'] .reservation-timeline-step strong { color: #9fb0c3; }

@media (max-width: 1000px) {
    .reservation-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .reservation-filters { grid-template-columns: 1fr 1fr; }
    .reservation-clear-filter { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 640px) {
    .reservation-summary-grid { gap: 10px; }
    .reservation-summary-card { padding: 15px; }
    .reservation-summary-card strong { font-size: 23px; }
    .reservation-filters { grid-template-columns: 1fr; margin: 0 14px 18px; padding: 14px; }
    .reservation-clear-filter { grid-column: auto; }
    .reservation-items-heading { flex-direction: column; }
    .reservation-items-heading .btn-secondary { width: 100%; justify-content: center; }
    .reservation-item-row { grid-template-columns: minmax(0,1fr) 44px; padding: 12px; }
    .reservation-material-field { grid-column: 1 / -1; }
    .reservation-quantity-field { grid-column: 1; }
    .reservation-remove-item { grid-column: 2; margin-top: 23px; }
    .reservation-detail-meta { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
    .reservation-item-row { grid-template-columns: minmax(0,1fr) 44px; gap: 10px; }
    .reservation-detail-hero { flex-direction: column; }
}
