:root {
    --bg: #0f1420;
    --bg-elevated: #161d2e;
    --bg-card: #1b2436;
    --border: #2a3550;
    --text: #e7ecf7;
    --text-dim: #93a1c0;
    --accent: #5b8cff;
    --accent-strong: #3f6fe0;
    --green: #2fbf71;
    --red: #ef5a5a;
    --orange: #f0a94e;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', sans-serif;
    min-height: 100vh;
}

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

/* ===== Layout ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
}

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

.brand-icon {
    font-size: 26px;
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text);
}

.nav-link.active {
    background: var(--accent);
    color: #fff;
}

.badge {
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.logout-link {
    margin-top: auto;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-weight: 500;
}

.logout-link:hover {
    background: var(--bg-card);
    color: var(--red);
}

.content {
    flex: 1;
    padding: 32px 40px;
    max-width: 1100px;
}

/* ===== Typography ===== */
.page-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 4px;
}

.page-sub {
    color: var(--text-dim);
    margin: 0 0 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 32px 0 14px;
}

.back-link {
    display: inline-block;
    color: var(--accent);
    margin-bottom: 16px;
    font-weight: 500;
}

/* ===== Flash messages ===== */
.flash-wrap {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-wrap-standalone {
    max-width: 380px;
    margin: 24px auto 0;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
}

.flash-success {
    background: rgba(47, 191, 113, 0.15);
    border: 1px solid var(--green);
    color: var(--green);
}

.flash-error {
    background: rgba(239, 90, 90, 0.15);
    border: 1px solid var(--red);
    color: var(--red);
}

/* ===== Login ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 30px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-brand {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--accent);
}

.login-card h1 {
    font-size: 20px;
    margin: 0 0 8px;
}

.login-sub {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 24px;
}

.login-card input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 14px;
    text-align: center;
}

.login-card button {
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}

.login-card button:hover {
    background: var(--accent-strong);
}

/* ===== Cards / stats ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: block;
    transition: border-color .15s, transform .15s;
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.stat-card-alert {
    border-color: var(--orange);
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
}

.stat-label {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 4px;
}

.notice-box {
    background: rgba(240, 169, 78, 0.12);
    border: 1px solid var(--orange);
    color: var(--orange);
    padding: 14px 18px;
    border-radius: var(--radius);
    font-weight: 500;
}

.notice-box a {
    color: var(--orange);
    text-decoration: underline;
    font-weight: 700;
    margin-right: 6px;
}

/* ===== Search / tables ===== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 420px;
}

.search-bar input {
    flex: 1;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
}

.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 18px;
    text-align: right;
    font-size: 14px;
}

th {
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}

.empty-row, .empty-note {
    color: var(--text-dim);
    text-align: center;
    padding: 24px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}

.btn:hover {
    opacity: 0.88;
}

.btn-small {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-warning {
    background: var(--orange);
    color: #1b1200;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

/* ===== Member detail ===== */
.summary-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.summary-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 22px;
    flex: 1;
    min-width: 200px;
}

.summary-label {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 20px;
    font-weight: 800;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-title {
    font-weight: 700;
    font-size: 15px;
}

.action-desc {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0;
}

.action-card input {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

/* ===== Pending deposits ===== */
.deposits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.deposit-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.deposit-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg);
    display: block;
}

.deposit-info {
    padding: 14px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.deposit-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
}

.deposit-row span {
    color: var(--text-dim);
}

.deposit-actions {
    padding: 14px 16px;
    display: flex;
    gap: 8px;
}

.deposit-actions form {
    flex: 1;
}

.deposit-actions .btn {
    width: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 800px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        border-left: none;
        border-bottom: 1px solid var(--border);
        padding: 14px 18px;
    }
    .brand-name {
        display: none;
    }
    .nav {
        flex-direction: row;
    }
    .logout-link {
        margin-top: 0;
    }
    .content {
        padding: 20px;
    }
}
