/* ==========================================================================
   فونت وزیرمتن (به صورت محلی، بدون نیاز به CDN)
   ========================================================================== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   متغیرها و پایه
   ========================================================================== */
:root {
    --gold: #c58f38;
    --gold-light: #dfc177;
    --gold-soft: #e8dec9;
    --maroon: #570007;
    --maroon-dark: #3e0001;
    --maroon-2: #3f0202;
    --green: #b8d2a9;
    --green-border: #98be81;
    --bg: #f4eee3;
    --text: #2c2118;
    --muted: #8a7a68;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(87, 0, 7, .08);
    --shadow-lg: 0 18px 50px rgba(87, 0, 7, .15);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

html, body {
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 100% 0, rgba(197, 143, 56, .12), transparent 45%),
        radial-gradient(circle at 0 100%, rgba(87, 0, 7, .10), transparent 45%);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.9;
}

a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--gold); }

.container-narrow {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 18px 16px 60px;
}

.container-wide {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 16px 60px;
}

/* ==========================================================================
   نوار اعلان بالای صفحه
   ========================================================================== */
.license-bar {
    text-align: center;
    font-size: 12.5px;
    color: var(--maroon-dark);
    background: linear-gradient(90deg, rgba(223,193,119,.35), rgba(223,193,119,.12));
    border: 1px solid rgba(197,143,56,.4);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

/* ==========================================================================
   عنوان اصلی
   ========================================================================== */
.top-title {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    border: 2px solid var(--gold);
    border-radius: 14px;
    padding: 16px 60px 16px 16px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.top-title::before {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: url('../images/logo.png') no-repeat center / contain;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
}

/* ==========================================================================
   تاریخ و ساعت
   ========================================================================== */
.time-part {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 14px;
    color: #fff;
}
.time-part > div {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6c6c6c, #5a5a5a);
    padding: 8px 16px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-weight: 600;
}
.time-part .calendar-part { flex: 1.4; justify-content: center; }
.time-part .clock-part { flex: 1; justify-content: center; }
.time-part img { width: 22px; height: 22px; filter: brightness(0) invert(1); }

/* ==========================================================================
   جدول قیمت‌ها
   ========================================================================== */
.price-card {
    margin-top: 16px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 2px solid var(--gold-light);
}
.price-table {
    width: 100%;
    border-collapse: collapse;
}
.price-table td {
    color: var(--maroon-2);
    font-weight: 700;
    padding: 18px 16px;
    border: 1px solid var(--gold-light);
    font-size: 16px;
    text-align: center;
    vertical-align: middle;
}
.price-table tr:nth-child(even) td { background: #fbf7ef; }
.price-table .label { color: var(--text); font-weight: 600; }
.price-table .value { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.price-table .unit { font-size: 12px; color: var(--muted); font-weight: 600; }

.arrow-up { color: #1f9d55; font-size: 15px; }
.arrow-down { color: #e3342f; font-size: 15px; }
.price-flash { animation: flash 1s ease; }
@keyframes flash {
    0% { background: #fff7cc; }
    100% { background: transparent; }
}

/* ==========================================================================
   ماشین حساب
   ========================================================================== */
.calculator-title {
    padding: 12px 0;
    text-align: center;
    margin: 22px 0 0;
    color: var(--maroon-2);
    font-weight: 800;
    font-size: 22px;
    background: var(--gold-soft);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.calc-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-top: 12px;
    border: 1px solid var(--gold-light);
}
.calc-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.calc-inputs .form-control,
.calc-inputs .form-select {
    flex: 1;
    min-width: 140px;
    background: #f1ede6;
    border: 1px solid #e0d6c5;
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}
.calc-inputs .form-control:focus,
.calc-inputs .form-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197,143,56,.2);
}
.calc-result {
    margin-top: 14px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--maroon);
    min-height: 24px;
}

/* ==========================================================================
   دکمه‌ها
   ========================================================================== */
.btn {
    display: inline-block;
    border: none;
    border-radius: 12px;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform .06s ease, filter .15s ease, box-shadow .15s ease;
    text-align: center;
    font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 15px 24px; font-size: 17px; }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #3a2600; box-shadow: var(--shadow); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-calc { background: var(--green); border: 2px solid var(--green-border); color: #163a06; border-radius: 14px; }
.btn-maroon { background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); color: #fff; }
.btn-success { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }
.btn-primary { background: linear-gradient(135deg, #3f7fd0, #2c5fa0); color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-light { background: #efe8db; color: var(--maroon); border: 1px solid var(--gold-light); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ==========================================================================
   کارت‌های عمومی
   ========================================================================== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid rgba(197,143,56,.25);
}
.card + .card { margin-top: 16px; }
.card-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--maroon);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   فرم‌ها
   ========================================================================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text); }
.form-control, .form-select {
    width: 100%;
    background: #f7f3ec;
    border: 1px solid #e0d6c5;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197,143,56,.18);
}
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.input-invalid { border-color: #e3342f !important; }
.field-error { color: #e3342f; font-size: 12.5px; margin-top: 5px; }

/* ==========================================================================
   هشدارها
   ========================================================================== */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-weight: 600; }
.alert-success { background: #e6f7ee; color: #1c7a44; border: 1px solid #b6e6cb; }
.alert-danger { background: #fdecea; color: #a02620; border: 1px solid #f5c4bf; }
.alert-info { background: #e9f2fb; color: #245c92; border: 1px solid #c3ddf5; }
.alert-warning { background: #fff6e5; color: #97640a; border: 1px solid #f3d8a1; }

/* ==========================================================================
   صفحه ورود
   ========================================================================== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 34px 28px;
    text-align: center;
    border-top: 5px solid var(--gold);
}
.login-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 8px;
    display: block;
}
.login-title { font-size: 20px; font-weight: 800; color: var(--maroon); margin: 6px 0 2px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ==========================================================================
   پنل مدیریت
   ========================================================================== */
.navbar {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}
.navbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    gap: 12px;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: #fff; }
.navbar-brand img { width: 34px; height: 34px; }
.navbar-menu { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.navbar-menu a {
    color: #f3e4c9;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: background .15s ease;
}
.navbar-menu a:hover { background: rgba(255,255,255,.12); color: #fff; }
.navbar-menu a.active { background: var(--gold); color: var(--maroon-dark); }
.navbar-toggle {
    display: none;
    background: rgba(255,255,255,.14);
    border: none;
    color: #fff;
    font-size: 22px;
    border-radius: 10px;
    padding: 4px 12px;
    cursor: pointer;
}

/* ==========================================================================
   جدول داده‌ها
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid #eee3d1;
    font-size: 14px;
}
.data-table thead th {
    background: var(--gold-soft);
    color: var(--maroon-2);
    font-weight: 700;
    white-space: nowrap;
}
.data-table tbody tr:hover { background: #fbf7ef; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.badge-green { background: #e6f7ee; color: #1c7a44; }
.badge-red { background: #fdecea; color: #a02620; }
.badge-gold { background: var(--gold-soft); color: var(--maroon-2); }

/* ==========================================================================
   ثبت مظنه (پنل)
   ========================================================================== */
.price-input {
    width: 100%;
    text-align: center;
    font-size: 46px;
    height: 108px;
    font-weight: 800;
    color: var(--maroon);
    border: 2px solid var(--gold-light);
    border-radius: 16px;
    background: #fffdf8;
    letter-spacing: 1px;
}
.price-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(197,143,56,.18); }
.plus-minus { display: flex; gap: 12px; margin-top: 14px; }
.plus-minus .btn { flex: 1; font-size: 34px; line-height: 1; padding: 14px; }

.timer-overlay {
    position: relative;
    height: 8px;
    background: #eee;
    margin-top: 12px;
    border-radius: 6px;
    overflow: hidden;
    display: none;
}
.timer-bar { height: 100%; background: linear-gradient(90deg, var(--gold), var(--maroon)); width: 100%; transition: width 1s linear; }
.timer-text { font-size: 16px; font-weight: 700; color: var(--maroon); margin-top: 8px; display: none; }
.status-badge { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; text-align: center; border: 1px solid rgba(197,143,56,.2); }
.stat-card .num { font-size: 22px; font-weight: 800; color: var(--maroon); }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ==========================================================================
   فوتر عمومی
   ========================================================================== */
.site-footer { text-align: center; color: #855e5f; margin-top: 40px; font-weight: 600; font-size: 13.5px; }
.site-footer img { width: 90px; vertical-align: middle; margin: 0 8px; }

/* ==========================================================================
   واکنش‌گرا
   ========================================================================== */
@media (max-width: 680px) {
    .navbar-toggle { display: block; }
    .navbar-menu {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        background: var(--maroon-dark);
        flex-direction: column;
        align-items: stretch;
        padding: 8px 12px 14px;
        gap: 2px;
    }
    .navbar-menu.open { display: flex; }
    .navbar-menu a { padding: 12px 14px; }
    .stat-grid { grid-template-columns: 1fr; }
    .top-title { font-size: 20px; }
    .price-input { font-size: 38px; height: 92px; }
}

/* ==========================================================================
   صفحه‌بندی (pagination)
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}
.pagination .page-item .page-link {
    display: block;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--gold-light);
    color: var(--maroon);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.pagination .page-item.active .page-link { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); }
.pagination .page-item.disabled .page-link { opacity: .45; cursor: not-allowed; }
.pagination svg { width: 16px; height: 16px; vertical-align: middle; }

.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; }
.d-flex { display: flex; } .gap-2 { gap: 8px; } .justify-center { justify-content: center; }
.flex-1 { flex: 1; }
