/* =====================================================================
   سامانه مدیریت مرکز رشد و نوآوری - سیستم طراحی
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&display=swap');

:root {
    --c-ink:        #16202A;   /* متن اصلی */
    --c-ink-soft:   #5B6B78;   /* متن ثانویه */
    --c-navy:       #132A3A;   /* رنگ نهادی اصلی - سایدبار/هدر */
    --c-navy-soft:  #1D3F55;
    --c-growth:     #1F7A5C;   /* سبز رشد - رنگ برند و اکشن اصلی */
    --c-growth-dark:#175D45;
    --c-amber:      #C97A2B;   /* هشدار / نیازمند توجه */
    --c-red:        #B84C4C;   /* خطر / حذف */
    --c-bg:         #F5F7F8;
    --c-card:       #FFFFFF;
    --c-line:       #E3E8EB;
    --radius:       10px;
    --shadow:       0 1px 2px rgba(19,42,58,.06), 0 1px 12px rgba(19,42,58,.04);
    --font: 'Vazirmatn', 'Tahoma', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-ink);
    direction: rtl;
    font-size: 15px;
    line-height: 1.75;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font-family: var(--font); font-size: 1em; }

h1,h2,h3,h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.4; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

/* ---------- چیدمان کلی ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--c-navy);
    color: #E7EDF0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6em;
    padding: 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .mark {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--c-growth);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 1rem;
}
.sidebar-brand .name { font-weight: 700; font-size: .95rem; }
.sidebar-brand .center-name { font-size: .75rem; color: #9FB3BE; }

.nav-group { padding: .75rem 0; }
.nav-group-title {
    padding: .4rem 1.1rem; font-size: .72rem; color: #7F94A0;
}
.nav-link {
    display: flex; align-items: center; gap: .65em;
    padding: .6rem 1.1rem;
    color: #D6E0E5;
    border-right: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,.05); }
.nav-link.active {
    background: rgba(31,122,92,.18);
    border-right-color: var(--c-growth);
    color: #fff;
    font-weight: 500;
}
.nav-link .ic { width: 1.1em; text-align: center; opacity: .9; }

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

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.5rem;
    background: var(--c-card);
    border-bottom: 1px solid var(--c-line);
    position: sticky; top: 0; z-index: 5;
}
.topbar .page-title { font-weight: 700; font-size: 1.05rem; }
.topbar .user-menu { display: flex; align-items: center; gap: .8em; }
.topbar .user-name { font-size: .9rem; }
.topbar .user-role { font-size: .74rem; color: var(--c-ink-soft); }

.content { padding: 1.5rem; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- کارت‌ها و جدول‌ها ---------- */
.card {
    background: var(--c-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}

table.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data-table th, table.data-table td {
    padding: .65rem .75rem; text-align: right; border-bottom: 1px solid var(--c-line);
}
table.data-table th { color: var(--c-ink-soft); font-weight: 600; font-size: .82rem; }
table.data-table tbody tr:hover { background: #FAFBFC; }
.table-wrap { overflow-x: auto; }

.empty-state {
    text-align: center; padding: 2.5rem 1rem; color: var(--c-ink-soft);
}
.empty-state .ic { font-size: 2.2rem; margin-bottom: .4rem; display: block; }

/* ---------- فرم‌ها ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.25rem; }
.form-grid.single { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 500; color: var(--c-ink-soft); }
.field .hint { font-size: .75rem; color: var(--c-ink-soft); }
input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], select, textarea {
    border: 1px solid var(--c-line);
    border-radius: 8px;
    padding: .55rem .75rem;
    background: #fff;
    color: var(--c-ink);
    outline: none;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--c-growth); box-shadow: 0 0 0 3px rgba(31,122,92,.12); }
textarea { resize: vertical; min-height: 90px; }

.form-actions { display: flex; gap: .6rem; margin-top: 1.25rem; }

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .45em;
    padding: .55rem 1.1rem;
    border-radius: 8px; border: 1px solid transparent;
    cursor: pointer; font-weight: 500; font-size: .9rem;
    transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(.94); }
.btn-primary { background: var(--c-growth); color: #fff; }
.btn-secondary { background: #fff; color: var(--c-ink); border-color: var(--c-line); }
.btn-danger { background: #fff; color: var(--c-red); border-color: #EBC9C9; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- برچسب وضعیت ---------- */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 500; }
.badge-green  { background: #E5F3ED; color: var(--c-growth-dark); }
.badge-amber  { background: #FBEEE0; color: var(--c-amber); }
.badge-red    { background: #FBEBEB; color: var(--c-red); }
.badge-gray   { background: #EEF1F2; color: var(--c-ink-soft); }

/* ---------- پیام‌ها ---------- */
.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.1rem; font-size: .9rem; }
.alert-success { background: #E5F3ED; color: var(--c-growth-dark); }
.alert-error   { background: #FBEBEB; color: var(--c-red); }
.alert-info    { background: #E9F1F5; color: var(--c-navy-soft); }

/* ---------- داشبورد: آمار و مسیر رشد ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-card); overflow: hidden; margin-bottom: 1.25rem; }
.stat-cell { flex: 1 1 150px; padding: 1.1rem 1.25rem; border-left: 1px solid var(--c-line); }
.stat-cell:last-child { border-left: none; }
.stat-cell .num { font-size: 1.6rem; font-weight: 700; color: var(--c-navy); display: block; }
.stat-cell .label { font-size: .8rem; color: var(--c-ink-soft); }

.growth-path { display: flex; align-items: stretch; gap: 0; margin-bottom: 1.25rem; }
.growth-step {
    flex: 1; background: var(--c-card); border: 1px solid var(--c-line);
    padding: 1.1rem 1rem; position: relative; text-align: center;
}
.growth-step:not(:first-child) { border-right: none; }
.growth-step .step-num { font-size: 1.5rem; font-weight: 700; color: var(--c-growth); }
.growth-step .step-label { font-size: .82rem; color: var(--c-ink-soft); margin-top: .2rem; }
.growth-step:not(:last-child)::after {
    content: '←'; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    color: var(--c-ink-soft); background: var(--c-bg); width: 24px; height: 24px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem;
    border: 1px solid var(--c-line);
}

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; }

/* ---------- صفحه ورود ---------- */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--c-navy); background-image: radial-gradient(circle at 20% 20%, var(--c-navy-soft), var(--c-navy) 60%);
    padding: 1rem;
}
.auth-card {
    background: #fff; border-radius: 14px; padding: 2rem 2.2rem; width: 100%; max-width: 380px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-card .brand { text-align: center; margin-bottom: 1.5rem; }
.auth-card .brand .mark {
    width: 48px; height: 48px; border-radius: 12px; background: var(--c-growth);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.3rem; margin: 0 auto .6rem;
}
.auth-card .brand .title { font-weight: 700; font-size: 1.05rem; }
.auth-card .brand .subtitle { font-size: .8rem; color: var(--c-ink-soft); }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 900px) {
    .form-grid, .two-col { grid-template-columns: 1fr; }
    .sidebar { position: fixed; right: 0; top: 0; transform: translateX(100%); transition: transform .2s; z-index: 50; }
    .sidebar.open { transform: translateX(0); }
    .content { padding: 1rem; }
    .growth-path { flex-direction: column; }
    .growth-step:not(:first-child) { border-right: 1px solid var(--c-line); border-top: none; }
    .growth-step:not(:last-child)::after { content: '↓'; left: 50%; top: auto; bottom: -12px; transform: translateX(50%); }
}

:focus-visible { outline: 2px solid var(--c-growth); outline-offset: 2px; }
