/* =========================================================================
   سامانه بایگانی و مدیریت اسناد — سیستم طراحی پایه
   پالت: سبز-اقیانوسی آرشیوی (برند) + کهربایی (تاکید ثانویه) روی زمینه کاغذی خنثی
   فونت: Vazirmatn (فارسی، خوانا، مدرن، وزن‌های متغیر برای سلسله‌مراتب typography)
   ========================================================================= */

:root {
    /* رنگ پایه */
    --paper: #F5F6F3;
    --surface: #FFFFFF;
    --ink-900: #16232B;
    --ink-700: #3B4A52;
    --ink-500: #6B7B82;
    --line: #E1E6E3;
    --line-strong: #CBD3CF;

    /* برند: سبز آرشیوی */
    --brand: #2F6F62;
    --brand-dark: #22514A;
    --brand-tint: #E7F1EE;

    /* تاکید ثانویه: کهربایی (نشان "به‌زودی"، هشدارهای ملایم) */
    --amber: #B8863B;
    --amber-tint: #F6EEE0;

    /* وضعیت‌ها */
    --danger: #B3261E;
    --danger-tint: #FBEAE9;
    --success: #1E7B45;
    --success-tint: #E8F5EC;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(22,35,43,0.06);
    --shadow-md: 0 8px 24px rgba(22,35,43,0.10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink-900);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.8;
}

h1, h2, h3, h4 { margin: 0 0 6px; font-weight: 800; color: var(--ink-900); letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p  { margin: 0 0 10px; color: var(--ink-700); }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--ink-500); font-size: 13.5px; }
.eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-tint);
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .02em;
    margin-bottom: 10px;
}

/* =========================================================================
   فرم‌ها
   ========================================================================= */
.form-field { margin-bottom: 16px; }
.form-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 6px;
}
.input, input[type=text].input, input[type=password].input,
.input select, select.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-900);
    font-family: inherit;
    font-size: 14.5px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, select.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}
.input::placeholder { color: var(--ink-500); opacity: .8; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   دکمه‌ها
   ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--ink-900); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-700); border-color: transparent; }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* =========================================================================
   کارت
   ========================================================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h2, .card-header h3 { margin: 0; }

/* =========================================================================
   پیام / Alert
   ========================================================================= */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-top: 14px; border: 1px solid transparent; }
.alert-error   { background: var(--danger-tint);  color: var(--danger);  border-color: #F3C9C5; }
.alert-success { background: var(--success-tint); color: var(--success); border-color: #C7E6D2; }

/* =========================================================================
   نشان (Badge)
   ========================================================================= */
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-soon { background: var(--amber-tint); color: var(--amber); }
.badge-on   { background: var(--success-tint); color: var(--success); }
.badge-off  { background: var(--danger-tint); color: var(--danger); }

/* =========================================================================
   جدول
   ========================================================================= */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
    text-align: right;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-500);
    padding: 10px 12px;
    border-bottom: 2px solid var(--line);
    background: transparent;
}
table.grid td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink-900); }
table.grid tr:hover td { background: var(--paper); }
table.grid a.row-action { font-size: 13px; font-weight: 600; }

/* =========================================================================
   Layout: پوسته پنل ادمین (Site.master)
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
    width: 252px;
    flex: 0 0 252px;
    background: var(--ink-900);
    color: #fff;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 18px; }
.sidebar-brand .brand-name { font-weight: 800; font-size: 15px; color: #fff; }
.sidebar-brand .brand-sub { display:block; font-size: 11px; color: rgba(255,255,255,.55); font-weight: 400; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.75);
    font-size: 14px;
    font-weight: 600;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--brand); color: #fff; }
.nav-item.is-disabled { color: rgba(255,255,255,.35); cursor: default; }
.nav-item.is-disabled:hover { background: transparent; }
.nav-item .nav-icon { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item .badge-soon { margin-inline-start: auto; }
.nav-section-title {
    margin-top: 14px;
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,.38);
    letter-spacing: .03em;
}

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 64px;
    flex: 0 0 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}
.topbar .page-title { margin: 0; font-size: 18px; }
.topbar-user { display: flex; align-items: center; gap: 14px; }
.topbar-user .user-name { font-size: 13.5px; font-weight: 700; color: var(--ink-700); }

.content { padding: 28px; max-width: 1080px; width: 100%; }

/* =========================================================================
   Layout: پوسته صفحات ورود (AuthSite.master)
   ========================================================================= */
.auth-body { background: var(--ink-900); }
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}
.auth-side {
    flex: 1 1 46%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 64px;
    color: #fff;
    background:
        radial-gradient(600px 400px at 20% 15%, rgba(47,111,98,.55), transparent 60%),
        linear-gradient(160deg, var(--ink-900) 0%, #0F1A20 100%);
}
.auth-side .brand-mark-lg { width: 56px; height: 56px; margin-bottom: 22px; }
.auth-side h2 { color: #fff; font-size: 26px; max-width: 380px; }
.auth-side p { color: rgba(255,255,255,.65); max-width: 380px; }

.auth-card-wrap {
    flex: 1 1 54%;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
}
.auth-card-header { margin-bottom: 22px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13.5px; }

@media (max-width: 860px) {
    .auth-side { display: none; }
    .auth-card-wrap { flex: 1 1 100%; }
}
@media (max-width: 860px) {
    .sidebar { display: none; }
    .content { padding: 18px; }
    .topbar { padding: 0 16px; }
}

/* دسترسی‌پذیری: نمایش واضح فوکوس کیبورد */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* دسترسی از راه پنل عمومی: کارت‌های داشبورد */
.quicklink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.quicklink-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    padding: 18px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink-900);
    transition: border-color .15s ease, transform .1s ease;
}
.quicklink-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); }
.quicklink-icon { width: 34px; height: 34px; color: var(--brand); }
.quicklink-icon svg { width: 100%; height: 100%; }
.quicklink-title { font-size: 13px; font-weight: 700; }

/* نوار ناوبری ساده پنل عمومی (بالای صفحه) */
.portal-nav { display: flex; gap: 4px; margin-inline-start: 18px; }
.portal-nav a {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-700);
}
.portal-nav a:hover { background: var(--paper); text-decoration: none; }
.portal-nav a.is-active { background: var(--brand-tint); color: var(--brand); }

/* =========================================================================
   داشبورد پنل عمومی: هیرو خوش‌آمدگویی + آمار مدارک + کارت‌های رنگی دسترسی سریع
   ========================================================================= */
.portal-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    background:
        radial-gradient(500px 260px at 15% 0%, rgba(184,134,59,.25), transparent 60%),
        linear-gradient(135deg, var(--ink-900) 0%, #1E3B33 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 28px 30px;
    margin-bottom: 18px;
}
.portal-hero-text h1 { color: #fff; font-size: 24px; margin: 4px 0 6px; }
.portal-hero-text p { color: rgba(255,255,255,.62); margin: 0; font-size: 13.5px; }

.portal-hero-progress { min-width: 220px; flex: 0 0 auto; }
.progress-ring-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.progress-ring-percent { font-size: 26px; font-weight: 800; color: #fff; }
.progress-ring-caption { font-size: 12.5px; color: rgba(255,255,255,.55); }
.progress-bar {
    width: 220px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #B8863B, #E3B463);
    border-radius: 999px;
    transition: width .4s ease;
}
.progress-stats { margin-top: 8px; font-size: 12.5px; color: rgba(255,255,255,.6); }
.progress-stats b { color: #fff; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-chip {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-inline-start: 4px solid var(--line-strong);
}
.stat-chip-num { font-size: 20px; font-weight: 800; color: var(--ink-900); }
.stat-chip-label { font-size: 12px; color: var(--ink-500); }
.stat-chip-pending { border-inline-start-color: var(--amber); }
.stat-chip-rejected { border-inline-start-color: var(--danger); }
.stat-chip-missing { border-inline-start-color: var(--ink-500); }

.quicklink-icon-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px;
}
.quicklink-icon-circle svg { width: 100%; height: 100%; }
.qc-blue   { background: #E7F0FB; color: #2563A8; }
.qc-purple { background: #F1EBFB; color: #6B46C1; }
.qc-amber  { background: var(--amber-tint); color: var(--amber); }
.qc-red    { background: var(--danger-tint); color: var(--danger); }
.qc-green  { background: var(--success-tint); color: var(--success); }
.qc-teal   { background: var(--brand-tint); color: var(--brand); }
.qc-gray   { background: #EEF0EF; color: var(--ink-500); }

@media (max-width: 560px) {
    .portal-hero { padding: 22px; }
    .portal-hero-progress { width: 100%; }
    .progress-bar { width: 100%; }
    .stat-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat-chip { padding: 10px 12px; }
}

/* لیست اطلاعیه‌ها در داشبورد پنل عمومی */
.announce-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.announce-item {
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    background: var(--paper);
}
.announce-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.announce-body { font-size: 13.5px; color: var(--ink-700); }
.announce-date { font-size: 11.5px; margin-top: 4px; }
