/* =========================================
   Abaya Factory Management System - Styles
   RTL Arabic UI — Premium Design
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --primary-gradient: linear-gradient(135deg, #6366f1, #4f46e5);
    --success: #059669;
    --success-light: #d1fae5;
    --success-gradient: linear-gradient(135deg, #34d399, #059669);
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --danger-gradient: linear-gradient(135deg, #f87171, #dc2626);
    --warning: #d97706;
    --warning-light: #fef3c7;
    --warning-gradient: linear-gradient(135deg, #fbbf24, #d97706);
    --info: #0891b2;
    --info-light: #cffafe;
    --info-gradient: linear-gradient(135deg, #22d3ee, #0891b2);
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 50px -12px rgba(0, 0, 0, 0.15);
    --radius: 10px;
    --radius-lg: 14px;
    --sidebar-width: 260px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    text-align: right;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===================== Layout ===================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===================== Sidebar ===================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 50%, #020617 100%);
    color: #fff;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-header .logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-bottom: 8px;
    object-fit: cover;
    border: 2px solid rgba(99, 102, 241, 0.5);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #e0e7ff;
    margin-bottom: 2px;
}

.sidebar-header small {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 400;
}

.sidebar-nav {
    padding: 8px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    border-right: 3px solid transparent;
    margin: 1px 0;
}

.sidebar-nav a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #e0e7ff;
    border-right-color: rgba(99, 102, 241, 0.5);
}

.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    border-right-color: #6366f1;
    font-weight: 600;
}

.sidebar-nav a .icon {
    margin-left: 10px;
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav .nav-section {
    padding: 18px 20px 6px;
    font-size: 10px;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, #0f172a, #020617);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    color: #e2e8f0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: #64748b;
}

.sidebar-user .logout-btn {
    color: #ef4444;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: var(--transition);
    background: rgba(239, 68, 68, 0.1);
    font-weight: 500;
}

.sidebar-user .logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ===================== Main Content ===================== */
.main-content {
    margin-right: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: var(--bg-card);
    padding: 12px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.top-bar .breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar .breadcrumb a {
    color: var(--text-muted);
    font-weight: 500;
}

.top-bar .breadcrumb a:hover {
    color: var(--primary);
}

.top-bar .breadcrumb .sep {
    color: #cbd5e1;
}

.top-bar .top-bar-info {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
    transition: var(--transition);
}

.hamburger-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.content {
    padding: 24px 28px;
    flex: 1;
}

.content-footer {
    padding: 16px 28px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
}

/* ===================== Page Header ===================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================== Cards ===================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(241, 245, 249, 0.5), transparent);
}

.card-body {
    padding: 20px;
}

/* ===================== Dashboard ===================== */
.dashboard-greeting {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.dashboard-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.tile {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}

.tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tile-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.tile-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

.tile.success::before {
    background: var(--success-gradient);
}

.tile.success .tile-value {
    color: var(--success);
}

.tile.danger::before {
    background: var(--danger-gradient);
}

.tile.danger .tile-value {
    color: var(--danger);
}

.tile.warning::before {
    background: var(--warning-gradient);
}

.tile.warning .tile-value {
    color: var(--warning);
}

.tile.info::before {
    background: var(--info-gradient);
}

.tile.info .tile-value {
    color: var(--info);
}

.dashboard-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.quick-actions .btn {
    font-size: 12px;
}

/* ===================== Tables ===================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 12px 14px;
    text-align: right;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    text-transform: none;
}

table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    transition: var(--transition);
}

table tbody tr {
    transition: var(--transition);
}

table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

table .text-center {
    text-align: center;
}

table .text-left {
    text-align: left;
}

table .number {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===================== Forms ===================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    transition: var(--transition);
    background: #fff;
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-left: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-inline {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    border-radius: 4px;
}

/* ===================== Buttons ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-success {
    background: var(--success-gradient);
    color: #fff;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.btn-danger {
    background: var(--danger-gradient);
    color: #fff;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-warning {
    background: var(--warning-gradient);
    color: #fff;
}

.btn-info {
    background: var(--info-gradient);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 10px;
}

.btn-icon {
    padding: 6px 8px;
    font-size: 14px;
    border-radius: 6px;
    line-height: 1;
}

.btn-group {
    display: flex;
    gap: 6px;
}

/* ===================== Alerts / Flash ===================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
    position: relative;
}

.alert.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        max-height: 80px;
        margin-bottom: 16px;
        padding: 14px 18px;
    }

    to {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding: 0 18px;
        overflow: hidden;
    }
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #ecfdf5);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fef2f2);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fffbeb);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: linear-gradient(135deg, #cffafe, #ecfeff);
    color: #155e75;
    border: 1px solid #a5f3fc;
}

/* ===================== Delete Modal ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: scaleIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-box .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.modal-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-box p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal-box .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ===================== Pagination ===================== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 24px 0;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: var(--transition);
    background: #fff;
}

.pagination a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .current {
    background: var(--primary-gradient);
    color: #fff;
    border-color: var(--primary);
}

/* ===================== Badges ===================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-info {
    background: var(--info-light);
    color: #155e75;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-primary {
    background: var(--primary-light);
    color: #3730a3;
}

/* ===================== Search ===================== */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: flex-end;
}

.search-box input {
    flex: 1;
}

.search-box label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

/* ===================== Empty State ===================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}

/* ===================== Settings ===================== */
.logo-preview {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
    background: #f8fafc;
    transition: var(--transition);
}

.logo-preview:hover {
    border-color: var(--primary);
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================== Utilities ===================== */
.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.fw-bold {
    font-weight: 700;
}

.fw-600 {
    font-weight: 600;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.d-flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

.gap-6 {
    gap: 6px;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* ===================== Login Page ===================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 50%, #020617 100%);
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 40%, rgba(99, 102, 241, 0.15), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(14, 165, 233, 0.1), transparent 50%);
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--primary-dark);
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 32px;
    font-weight: 500;
}

/* ===================== Print Styles ===================== */
@media print {
    body {
        background: #fff;
        font-size: 12px;
    }

    .sidebar,
    .top-bar,
    .no-print,
    .btn,
    .pagination,
    .content-footer,
    .sidebar-overlay,
    .hamburger-btn,
    .dashboard-two-col .card:last-child {
        /* Hide charts in print usually better */
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        width: 100% !important;
    }

    .content {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
        break-inside: avoid;
    }

    .card-header {
        background: none !important;
        border-bottom: 2px solid #000 !important;
        color: #000 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    table {
        font-size: 11px;
        width: 100% !important;
    }

    table th,
    table td {
        border: 1px solid #ddd !important;
        padding: 6px !important;
        color: #000 !important;
    }

    table th {
        background-color: #f0f0f0 !important;
    }

    .print-header {
        display: block !important;
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }

    .print-header h1 {
        font-size: 20px;
        margin: 0;
    }

    .print-header p {
        margin: 5px 0 0;
        font-size: 12px;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }

    /* Ensure tiles print reasonably well if needed, or hide */
    .dashboard-tiles {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .tile {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    @page {
        margin: 1cm;
        size: A4;
    }
}

.print-header {
    display: none;
}

/* ===================== Labels ===================== */
.label-container {
    display: inline-block;
    border: 1px dashed #999;
    padding: 10px 15px;
    margin: 5px;
    font-size: 12px;
    page-break-inside: avoid;
}

.label-container h3 {
    font-size: 14px;
    border-bottom: 1px solid #333;
    margin-bottom: 5px;
    padding-bottom: 3px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

/* ===================== Lines Table ===================== */
.lines-table input,
.lines-table select {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

.lines-table input:focus,
.lines-table select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

.lines-table .remove-line {
    cursor: pointer;
    color: var(--danger);
    font-size: 18px;
    border: none;
    background: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.lines-table .remove-line:hover {
    background: var(--danger-light);
}

/* ===================== Responsive ===================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-right: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-two-col {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .content {
        padding: 16px;
    }

    .top-bar {
        padding: 10px 16px;
    }

    .quick-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================== Modal ===================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-icon {
    font-size: 48px;
    color: var(--danger);
    margin-bottom: 20px;
}

.modal-box h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.5rem;
}

.modal-box p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-actions .btn {
    min-width: 100px;
}