@import "tailwindcss";

@custom-variant dark (&:where(.dark, .dark *));

@theme {
    --font-sans: "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
    --default-font-family: var(--font-sans);
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/vazirmatn-arabic-wght-normal.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/vazirmatn-latin-ext-wght-normal.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/vazirmatn-latin-wght-normal.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@layer base {
    *,
    *::before,
    *::after {
        font-family: var(--font-sans) !important;
    }

    th {
        text-align: right;
        direction: rtl;
        vertical-align: middle;
    }
}

.table-card table {
    border-collapse: collapse;
}

.table-card thead tr {
    background-color: #374151;
}

.table-card thead th {
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid #1f2937;
    text-align: right;
    direction: rtl;
}

.table-card tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    direction: rtl;
    text-align: right;
}

.table-card tbody tr + tr {
    border-top: none;
}

.table-card tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.table-card tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.table-card tbody tr:hover {
    background-color: #ecfdf5;
}

.dark .table-card tbody tr:nth-child(odd) {
    background-color: #111827;
}

.dark .table-card tbody tr:nth-child(even) {
    background-color: #1f2937;
}

.dark .table-card tbody tr:hover {
    background-color: #052e16;
}

.form-card,
.form-section {
    border-radius: 1rem;
    border: 1px solid #f3f4f6;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 36px -18px rgba(15, 23, 42, 0.16);
}

.form-card {
    padding: 1.5rem;
}

.form-section {
    padding: 1.5rem;
}

.dark .form-card,
.dark .form-section {
    border-color: #1f2937;
    background-color: #111827;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 36px -18px rgba(0, 0, 0, 0.6);
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dark .form-label {
    color: #d1d5db;
}

.form-control {
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    padding: 0.45rem 0.7rem;
    font-size: 0.875rem;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.dark .form-control {
    border-color: #374151;
    background-color: #1f2937;
    color: #f3f4f6;
}

.form-control::placeholder {
    color: #9ca3af;
}

.dark .form-control::placeholder {
    color: #6b7280;
}

.form-control:focus {
    outline: none;
    border-color: #16a34a;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.dark .form-control:focus {
    border-color: #22c55e;
    background-color: #111827;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.form-error {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: #dc2626;
}

.form-card input[type="checkbox"],
.form-section input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #15803d;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: #15803d;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    box-shadow: 0 2px 10px -2px rgba(22, 163, 74, 0.4);
    transition: background-color 0.15s;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background-color: #f3f4f6;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    transition: background-color 0.15s;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.dark .btn-secondary {
    background-color: #374151;
    color: #e5e7eb;
}

.dark .btn-secondary:hover {
    background-color: #4b5563;
}

input,
select,
textarea,
button,
a {
    border-radius: 4px;
}

@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body {
        background: white;
        margin: 0;
        padding: 20px;
    }

    .min-h-screen {
        min-height: auto;
    }

    aside,
    .fixed {
        display: none !important;
    }

    .form-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        background: white;
        padding: 12px;
    }

    table {
        font-size: 11px;
    }

    thead {
        background-color: #374151 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    thead th {
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    tfoot {
        background-color: #f9fafb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.print-only {
    display: none;
}
