/* سامانه پرکیس — تم نهایی: مینیمال، سبز + نارنجی
   فونت: Vazirmatn برای متن، IBM Plex Mono برای اعداد
*/

:root {
    --green-dark: #24503C;
    --green-mid: #4F9873;
    --green-line: #CFE6D9;
    --green-tint: #EEF6F1;
    --orange: #E2792E;
    --orange-dark: #B85F1F;
    --orange-tint: #FBE7D2;
    --paper: #FFFFFF;
    --page: #F5F8F6;
    --text: #1F2A24;
    --text-muted: #6C7A72;
    --red: #C4433A;
    --red-tint: #FBE7E5;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    background: var(--page);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}

.mono {
    font-family: 'IBM Plex Mono', 'Vazirmatn', monospace;
    font-variant-numeric: tabular-nums;
}

.shell {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--green-dark);
    color: #EAF3ED;
    padding: 28px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
}

.brand-mark {
    width: 52px;
    height: 40px;
    border-radius: 10px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 5px;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.brand-text small {
    display: block;
    font-size: 11.5px;
    color: #A9CBB8;
    margin-top: 2px;
}

.nav-group { margin-bottom: 26px; }

.sidebar-user {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.14);
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #EAF3ED;
}

.nav-label {
    display: block;
    font-size: 11px;
    color: #8FB09E;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding: 0 10px;
}

.nav a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: #D4E6DB;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }

.nav a.active {
    background: var(--orange);
    color: #fff;
    font-weight: 600;
}

.sidebar .btn-ghost { color: #EAF3ED; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }
.sidebar .btn-ghost:hover { background: rgba(255,255,255,0.14); }

/* --- Content --- */
.content {
    flex: 1;
    min-width: 0;
    padding: 36px 44px;
    max-width: 1200px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--green-dark);
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13.5px;
    max-width: 60ch;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary { background: var(--green-dark); color: #fff; }
.btn-primary:hover { background: #1B3D2E; }

.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-dark); }

.btn-ghost { background: transparent; color: var(--green-dark); border-color: var(--green-line); }
.btn-ghost:hover { background: var(--green-tint); }

.btn-danger { background: transparent; color: var(--red); border-color: var(--red-tint); }
.btn-danger:hover { background: var(--red-tint); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }

/* --- Cards & Tables --- */
.card {
    background: var(--paper);
    border: 1px solid var(--green-line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
}

.table-wrap {
    background: var(--paper);
    border: 1px solid var(--green-line);
    border-radius: var(--radius);
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
    text-align: right;
    background: var(--green-dark);
    color: #EAF3ED;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
}

tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--green-line);
    white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--green-tint); }

.text-muted { color: var(--text-muted); }
.text-left { text-align: left; }
.num { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-accent { background: var(--green-tint); color: var(--green-mid); }
.badge-amber { background: var(--orange-tint); color: var(--orange-dark); }
.badge-red { background: var(--red-tint); color: var(--red); }
.badge-muted { background: #EAEFE9; color: var(--text-muted); }

/* --- Forms --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--green-dark);
}

.field .hint { font-size: 11.5px; color: var(--text-muted); }

input, select, textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid var(--green-line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--orange);
    outline-offset: 1px;
    border-color: var(--orange);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    grid-column: 1 / -1;
}

/* --- Toolbar / filters --- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.toolbar select, .toolbar input { min-width: 160px; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: var(--green-tint);
    border: 1px solid var(--green-line);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.stat .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat .value { font-size: 22px; font-weight: 700; color: var(--green-dark); font-family: 'IBM Plex Mono', monospace; }

.stat.accent { background: var(--orange-tint); border-color: #F0C79A; }
.stat.accent .value { color: var(--orange-dark); }

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state strong { display: block; color: var(--green-dark); font-size: 15px; margin-bottom: 6px; }

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-amber { background: var(--orange-tint); color: var(--orange-dark); border-color: #F0C79A; }
.alert-red { background: var(--red-tint); color: var(--red); border-color: #F0C2BE; }

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .content { padding: 24px; }
    .form-grid { grid-template-columns: 1fr; }
}
