@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --ink:        #232A31;
    --navy:       #1E3245;
    --navy-dark:  #162432;
    --brass:      #B8863B;
    --brass-dark: #96692A;
    --paper:      #F7F4EC;
    --paper-2:    #FBF9F4;
    --line:       #DDD5C4;
    --line-soft:  #EAE4D6;
    --success:    #3F7D5C;
    --danger:     #B4453C;
    --muted:      #6E7680;

    --radius: 4px;
    --shadow-1: 0 1px 2px rgba(30, 50, 69, 0.08);
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-weight: 700; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 .8em; }

/* ---------------- Layout shell ---------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--navy);
    color: #E9EEF2;
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar .brand .mark {
    width: 34px; height: 34px;
    border: 2px solid var(--brass);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--brass);
    font-weight: 700;
    font-size: .85rem;
}

.sidebar .brand .org-name {
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
}
.sidebar .brand .org-sub {
    font-size: .72rem;
    color: rgba(255,255,255,.55);
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar nav a {
    padding: 10px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,.78);
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s ease, color .15s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active {
    background: rgba(184,134,59,.18);
    color: #fff;
    border-right: 3px solid var(--brass);
    padding-right: 9px;
}

.sidebar .spacer { flex: 1; }

.sidebar .user-box {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 14px;
    font-size: .82rem;
    color: rgba(255,255,255,.65);
}
.sidebar .user-box strong { display: block; color: #fff; font-size: .88rem; margin-bottom: 2px; }
.sidebar .user-box a.logout { color: var(--brass); font-size: .8rem; }

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

.topbar {
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar .page-title { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.topbar .page-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }

.content { padding: 26px 28px 40px; }

/* ---------------- Cards / registry sheet ---------------- */
.sheet {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    padding: 22px 24px;
    margin-bottom: 20px;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

/* ---------------- Indicator stamp badge ---------------- */
.stamp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px dashed var(--brass);
    color: var(--brass-dark);
    background: rgba(184,134,59,.06);
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: .3px;
    white-space: nowrap;
}
.stamp .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }

/* ---------------- Stats row ---------------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.stat-card .num { font-size: 1.7rem; font-weight: 700; color: var(--navy); }
.stat-card .label { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.stat-card.accent { border-right: 3px solid var(--brass); }

/* ---------------- Table (ledger style) ---------------- */
table.ledger { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.ledger thead th {
    text-align: right;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 2px solid var(--navy);
    padding: 10px 10px;
    font-size: .82rem;
    white-space: nowrap;
}
table.ledger tbody td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
table.ledger tbody tr:hover { background: var(--paper); }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 600;
}
.badge.incoming { background: #E3EEE7; color: var(--success); }
.badge.outgoing { background: #EFE3DC; color: var(--brass-dark); }
.badge.urgent   { background: #F5DEDB; color: var(--danger); }

/* ---------------- Forms ---------------- */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

input[type=text], input[type=date], input[type=email], input[type=password],
select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .92rem;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: 0 0 0 3px rgba(184,134,59,.15);
}
textarea { resize: vertical; min-height: 90px; }

.file-drop {
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    color: var(--muted);
    font-size: .86rem;
    background: var(--paper);
}
.file-drop.has-file { border-color: var(--success); color: var(--success); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s ease;
}
.btn:hover { filter: brightness(0.94); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-brass   { background: var(--brass); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--navy); }
.btn-danger  { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .88rem; margin-bottom: 16px; }
.alert-error   { background: #F8E4E1; color: var(--danger); border: 1px solid #EBC3BC; }
.alert-success { background: #E4F0E9; color: var(--success); border: 1px solid #C4DED0; }

/* ---------------- Login page ---------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    background-image: radial-gradient(circle at 20% 20%, rgba(184,134,59,.15), transparent 45%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 6px;
    padding: 36px 32px;
    text-align: center;
}
.login-card .mark {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    border: 2px solid var(--brass);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--brass-dark);
    font-weight: 700;
}
.login-card h1 { font-size: 1.15rem; margin-bottom: 4px; }
.login-card .desc { color: var(--muted); font-size: .85rem; margin-bottom: 26px; }

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
}
.btn-google:hover { background: var(--paper); }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .78rem; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.admin-login-toggle { font-size: .78rem; color: var(--muted); margin-top: 18px; }
.admin-login-toggle a { color: var(--brass-dark); font-weight: 600; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; }
    .sidebar nav { flex-direction: row; overflow-x: auto; }
    .sidebar .user-box, .sidebar .spacer { display: none; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 18px; }
}
