@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');
@import url('https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css');
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-overlay: rgba(15, 23, 42, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --border: #334155;
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --sidebar-width: 280px;
    --header-height: 4rem;
}
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
.layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 2rem;
    width: 100%;
}
.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.brand i {
    color: var(--accent);
    font-size: 1.8rem;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 600;
}
.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(-4px);
}
.nav-link.active {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.nav-link i {
    font-size: 1.25rem;
}
.logout-btn {
    margin-top: auto;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 0.95rem;
    font-weight: 700;
}
.logout-btn:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
h1 {
    margin-bottom: 2rem;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: 0.2s;
    font-size: 0.95rem;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}
.btn-icon {
    padding: 0.5rem;
    aspect-ratio: 1;
    border-radius: 50%;
}
.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: var(--danger-hover);
}
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: #475569;
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-row {
    display: flex;
    gap: 1rem;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}
.input,
.select,
.textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: white;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.95rem;
}
.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    outline: none;
}
.file-input-wrapper {
    border: 2px dashed var(--border);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    background: var(--bg-primary);
}
.file-input-wrapper:hover {
    border-color: var(--accent);
}
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
th,
td {
    padding: 1rem 1.5rem;
    text-align: right;
}
th {
    background: var(--bg-tertiary);
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
}
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}
.mobile-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    .mobile-header {
        display: flex;
    }
    .sidebar {
        width: 280px;
        height: 100vh;
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .sidebar nav {
        display: flex;
        flex-direction: column;
        height: calc(100% - 80px);
        overflow: visible;
        padding-bottom: 0;
    }
    .sidebar .brand {
        display: flex;
        margin-bottom: 2.5rem;
        justify-content: flex-start;
    }
    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 1.5rem 1rem;
    }
    .nav-link {
        margin-bottom: 0.5rem;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    .logout-btn {
        margin-top: auto;
    }
    h1 {
        font-size: 1.5rem;
        flex-wrap: wrap;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .grid {
        grid-template-columns: 1fr !important;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    form {
        flex-direction: column;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
@media print {
    @page {
        size: A4;
        margin: 5mm;
    }
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        direction: rtl !important;
    }
    .no-print,
    .sidebar,
    .btn,
    .layout>*:not(.main-content) {
        display: none !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-bottom: 2rem !important;
    }
    h1,
    h2,
    h3,
    h4 {
        color: #000 !important;
        page-break-after: avoid;
    }
    .table-responsive {
        border: none !important;
        overflow: visible !important;
    }
    html,
    body {
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed;
        font-size: 9.5pt;
        margin-bottom: 5px;
    }
    th,
    td {
        border: 1px solid #666 !important;
        padding: 4px 8px !important;
        text-align: right !important;
        vertical-align: middle;
        word-wrap: break-word;
        overflow-wrap: break-word;
        color: #000 !important;
        background: transparent !important;
        line-height: 1.3;
    }
    thead {
        display: table-header-group;
    }
    tr {
        page-break-inside: avoid;
    }
    th {
        background-color: #f0f0f0 !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .report-view-table th,
    .report-view-table td {
        width: auto !important;
    }
    .report-view-table td:last-child {
        min-width: 15%;
    }
    img {
        max-width: 120px !important;
        height: auto;
        display: block;
        margin-top: 5px;
    }
    input,
    textarea {
        border: none;
        display: none;
    }
}
tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}
tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}
.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}
.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.confirm-box {
    text-align: center;
}
.confirm-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 1rem;
    background: rgba(239, 68, 68, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-enter {
    animation: fadeIn 0.4s ease-out forwards;
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
        padding: 1rem;
    }
    .nav-toggle {
        display: block;
    }
}
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 1em;
}
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-primary);
}
.checklist-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    overflow: hidden;
}
.checklist-option:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}
.checklist-option.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    color: white;
}
.checklist-option.selected::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent var(--accent) transparent transparent;
}
.checklist-option input {
    display: none;
}
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
        width: 100vw;
    }
    h1 {
        font-size: 1.5rem;
    }
    .card {
        padding: 1rem;
    }
    button,
    .btn {
        min-height: 44px;
    }
}
.radio-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.realtime-clock-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.realtime-clock-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--accent);
}
.clock-icon {
    font-size: 1.75rem;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.6rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.clock-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.clock-time {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 0.5px;
}
.clock-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 2px;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.header-container .btn {
    width: auto;
    margin: 0;
}
.main-content {
    padding: 2.5rem;
}
h1 {
    margin-bottom: 0.5rem;
}
h1+p {
    margin-bottom: 0 !important;
}