@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --dl-primary: #0d9488;
    --dl-primary-dark: #0f766e;
    --dl-primary-deep: #115e59;
    --dl-accent: #06b6d4;
    --dl-ink: #123c40;
    --dl-muted: #64748b;
    --dl-bg: #eef6f6;
    --dl-card-border: #dcebec;
    --dl-radius: 14px;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: linear-gradient(180deg, #e6f2f2 0%, var(--dl-bg) 240px, var(--dl-bg) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--dl-ink);
}

main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, .fw-bold, .navbar-brand {
    font-weight: 700;
    color: var(--dl-ink);
}

.ltr {
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
}

.ltr-block {
    direction: ltr;
    text-align: right;
    unicode-bidi: embed;
}

.dl-navbar {
    background: linear-gradient(120deg, var(--dl-primary-deep) 0%, var(--dl-primary-dark) 55%, var(--dl-primary) 100%);
    box-shadow: 0 2px 14px rgba(13, 148, 136, 0.28);
}

.dl-navbar .navbar-brand, .dl-navbar .nav-link, .dl-navbar .navbar-text, .dl-navbar .btn {
    color: #f0fdfb !important;
}

.dl-navbar .nav-link.active, .dl-navbar .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
}

.dl-brand-icon {
    width: 26px;
    height: 26px;
    fill: #ffffff;
    margin-left: 0.45rem;
}

.btn-primary {
    --bs-btn-bg: var(--dl-primary);
    --bs-btn-border-color: var(--dl-primary);
    --bs-btn-hover-bg: var(--dl-primary-dark);
    --bs-btn-hover-border-color: var(--dl-primary-dark);
    --bs-btn-active-bg: var(--dl-primary-deep);
    --bs-btn-active-border-color: var(--dl-primary-deep);
    --bs-btn-disabled-bg: #7cc7bf;
    --bs-btn-disabled-border-color: #7cc7bf;
}

.btn-outline-primary {
    --bs-btn-color: var(--dl-primary-dark);
    --bs-btn-border-color: var(--dl-primary);
    --bs-btn-hover-bg: var(--dl-primary);
    --bs-btn-hover-border-color: var(--dl-primary);
    --bs-btn-active-bg: var(--dl-primary-dark);
    --bs-btn-active-border-color: var(--dl-primary-dark);
}

.btn-outline-secondary {
    --bs-btn-color: #46656a;
    --bs-btn-border-color: #9fc3c4;
}

.text-primary { color: var(--dl-primary-dark) !important; }
.link-primary { color: var(--dl-primary-dark) !important; }

.form-control:focus, .form-select:focus {
    border-color: #5ec8bd;
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}

.form-check-input:checked {
    background-color: var(--dl-primary);
    border-color: var(--dl-primary);
}

.form-check-input:focus {
    border-color: #5ec8bd;
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
}

.page-item.active .page-link {
    background-color: var(--dl-primary);
    border-color: var(--dl-primary);
}

.nav-tabs .nav-link.active {
    color: var(--dl-primary-dark);
    border-color: #dcebec #dcebec #fff;
    font-weight: 700;
}

.card-shadow {
    border: 1px solid var(--dl-card-border);
    border-radius: var(--dl-radius);
    box-shadow: 0 4px 18px rgba(17, 94, 89, 0.06);
}

.card-shadow .card-header {
    background: transparent;
    border-bottom: 1px solid var(--dl-card-border);
}

.stat-card {
    border: 1px solid var(--dl-card-border);
    border-radius: var(--dl-radius);
    box-shadow: 0 4px 18px rgba(17, 94, 89, 0.06);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--dl-primary), var(--dl-accent));
}

.stat-card .stat-big {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card .stat-label {
    color: var(--dl-muted);
    font-size: 0.85rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--dl-card-border);
    color: var(--dl-primary-deep);
}

.auth-card {
    max-width: 470px;
    margin: 2rem auto;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(17, 94, 89, 0.14);
    overflow: hidden;
}

.auth-card .auth-head {
    background: linear-gradient(120deg, var(--dl-primary-deep), var(--dl-primary));
    color: #fff;
    padding: 1.4rem 1rem 1.2rem;
    text-align: center;
}

.auth-card .auth-head svg {
    width: 40px;
    height: 40px;
    fill: #fff;
}

.auth-card .auth-head .t {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 0.4rem;
}

.auth-card .auth-head .s {
    font-size: 0.8rem;
    opacity: 0.85;
}

.alert-form { border-radius: 0.7rem; }

.toast-msg {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 3000;
    padding: 0.8rem 1.2rem;
    border-radius: 0.6rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    max-width: 24rem;
    animation: toast-in 0.3s ease;
}

.toast-ok { background: linear-gradient(120deg, #0f766e, #10b981); }
.toast-err { background: linear-gradient(120deg, #b91c1c, #ef4444); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.jaw-chart {
    border: 1px solid var(--dl-card-border);
    border-radius: 0.9rem;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff, #f2f9f9);
}

.jaw-chart .tooth {
    width: 2.5rem;
    height: 2.5rem;
    margin: 2px;
    border-radius: 0.5rem;
    border: 1px solid #bfd9d8;
    background: #fff;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    color: var(--dl-ink);
}

.jaw-chart .tooth:hover:not(:disabled) {
    border-color: var(--dl-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.jaw-chart .tooth.selected {
    background: linear-gradient(135deg, var(--dl-primary), var(--dl-accent));
    color: #fff;
    border-color: var(--dl-primary-dark);
}

.jaw-chart .tooth:disabled {
    opacity: 0.25;
}

.arch-label {
    text-align: center;
    color: var(--dl-muted);
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

.chips .chip {
    display: inline-block;
    background: #d7f1ee;
    color: var(--dl-primary-deep);
    border-radius: 1rem;
    padding: 0.15rem 0.7rem;
    margin: 0.15rem;
    font-size: 0.8rem;
}

.dl-date-icon { color: var(--dl-primary-dark); }

.status-badge {
    font-weight: 400;
    white-space: nowrap;
}

.status-registered { background: #94a3b8; color: #fff; }
.status-couriertolab { background: #38bdf8; color: #083344; }
.status-receivedatlab { background: #0d9488; color: #fff; }
.status-needsinfo { background: #fbbf24; color: #451a03; }
.status-inproduction { background: #6366f1; color: #fff; }
.status-readyfordelivery { background: #10b981; color: #fff; }
.status-couriortoclinic { background: #fb923c; color: #431407; }
.status-delivered { background: #047857; color: #fff; }
.status-canceled { background: #64748b; color: #fff; }
.status-returned { background: #e11d48; color: #fff; }

.timeline .titem {
    border-right: 3px solid #bfe3de;
    padding-right: 1rem;
    margin-bottom: 1.1rem;
    position: relative;
}

.timeline .titem::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 0.25rem;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dl-primary), var(--dl-accent));
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #bfe3de;
}

.timeline .titem .tdate {
    font-size: 0.78rem;
    color: var(--dl-muted);
}

.timeline .titem .tnote {
    font-size: 0.85rem;
    color: #33555a;
    background: #f0f7f7;
    border-radius: 0.5rem;
    padding: 0.35rem 0.6rem;
    display: inline-block;
}

table td, table th { vertical-align: middle; }

.table > thead.table-light th {
    background: #e9f4f3;
    color: var(--dl-primary-deep);
    border-bottom: 1px solid #d5e8e6;
}

.table-compact td, .table-compact th { padding: 0.45rem 0.6rem; }

.filter-bar {
    background: #fff;
    border: 1px solid var(--dl-card-border);
    border-radius: var(--dl-radius);
    padding: 0.9rem;
}

.filter-bar .form-label {
    font-size: 0.8rem;
    color: var(--dl-muted);
    margin-bottom: 0.25rem;
}

.btn-group-jaw { flex-wrap: wrap; }

.form-note {
    font-size: 0.8rem;
    color: var(--dl-muted);
}

footer {
    background: linear-gradient(120deg, var(--dl-primary-deep), var(--dl-primary-dark));
    color: #d9f2ee !important;
}

footer a { color: #a7e3dc; }

.dl-hero-icon {
    width: 84px;
    height: 84px;
    fill: #fff;
    opacity: 0.95;
}

::selection { background: #b9e2dd; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #eef4f4; }
::-webkit-scrollbar-thumb { background: #b3d4d1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--dl-primary-dark); }

[data-jdp] { cursor: pointer; }

/* ---------- Landing page ---------- */

.hero {
    padding: 2.2rem 1rem 1rem;
}

.hero h1 {
    font-size: 1.9rem;
}

.hero .lead {
    max-width: 46rem;
    font-size: 1rem;
}

.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--dl-primary-deep), var(--dl-accent));
    box-shadow: 0 12px 30px rgba(13, 148, 136, 0.35);
    color: #fff;
}

.hero-icon svg {
    width: 48px;
    height: 48px;
    fill: #fff;
}

.feature-card .feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #d9f1ee;
    color: var(--dl-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
}

.feature-card .feature-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.feature-card h5 {
    font-size: 1.02rem;
}

.how-step {
    background: #fff;
    border: 1px solid var(--dl-card-border);
    border-radius: var(--dl-radius);
    padding: 1rem 1.2rem;
    width: 13rem;
    text-align: center;
}

.how-step .how-num {
    width: 34px;
    height: 34px;
    line-height: 34px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dl-primary), var(--dl-accent));
    color: #fff;
    font-weight: 700;
}

.how-step .how-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* ---------- Public tracking ---------- */

.track-hero {
    color: var(--dl-primary-dark);
}

.track-hero svg {
    fill: var(--dl-primary);
    opacity: 0.9;
}

/* ---------- Reports bars ---------- */

.bar-track {
    background: #eef5f5;
    border-radius: 1rem;
    height: 12px;
    overflow: hidden;
    min-width: 120px;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dl-primary), var(--dl-accent));
    border-radius: 1rem;
    min-width: 2px;
}

/* ---------- Guide ---------- */

.guide-list {
    padding-right: 1.2rem;
    margin: 0;
}

.guide-list li {
    margin-bottom: 0.6rem;
    line-height: 1.9;
}

/* ---------- Printable ticket ---------- */

.dl-ticket {
    border: 2px solid var(--dl-primary-dark);
    background: #fff;
}

.dl-ticket .ticket-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--dl-primary-deep);
}

.dl-ticket .ticket-label {
    font-size: 0.78rem;
    color: var(--dl-muted);
    margin-bottom: 0.15rem;
}

.dl-ticket .ticket-grid > div {
    border-right: 1px dashed #cfe3e0;
    padding-left: 0.75rem;
}

.dl-ticket .ticket-teeth {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dl-ticket .ticket-tooth {
    border: 1px solid var(--dl-primary-dark);
    border-radius: 0.45rem;
    padding: 0.15rem 0.55rem;
    font-weight: 700;
    background: #f2f9f9;
}

.dl-ticket .ticket-box {
    border: 1px solid #cfe3e0;
    border-radius: 0.6rem;
    background: #f7fbfb;
    padding: 0.5rem 0.75rem;
    white-space: pre-wrap;
}

.dl-barcode {
    max-width: 100%;
}

@media print {
    .dl-navbar, footer, .toast-msg, .btn, form.d-print-none, .no-print { display: none !important; }
    .card-shadow { box-shadow: none; border: 1px solid #ddd; }
    body { background: #fff !important; }
    .dl-ticket { border-width: 2px; }
    main.container { max-width: 100%; padding: 0 !important; margin: 0 !important; }
}
