* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    line-height: 1.6;
}

/* ===== Auth pages (login / register) ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: #1e293b;
}

.auth-subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 28px;
    font-size: 14px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.field input,
.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.field input:focus,
.field select:focus {
    border-color: #6366f1;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #6366f1;
    color: #fff;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-full {
    width: 100%;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: #64748b;
}

.auth-switch a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
}

/* ===== Navbar ===== */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a {
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    color: #4f46e5;
}

.nav-user {
    font-size: 14px;
    color: #64748b;
}

.nav-logout {
    color: #dc2626 !important;
}

/* ===== Container ===== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-head h1 {
    font-size: 24px;
    font-weight: 700;
}

/* ===== Summary cards ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.card {
    background: #fff;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #eef2f7;
}

.card-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 8px;
}

.card-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
}

/* ===== Panel + table ===== */
.panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #eef2f7;
    overflow: hidden;
}

.panel-head {
    padding: 18px 22px;
    border-bottom: 1px solid #eef2f7;
}

.panel-head h2 {
    font-size: 17px;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 12px 22px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    background: #f8fafc;
}

.table td {
    padding: 14px 22px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

.table .right {
    text-align: right;
}

.amount {
    font-weight: 700;
    color: #1e293b;
}

.tag {
    display: inline-block;
    padding: 4px 10px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tag-muted {
    background: #f1f5f9;
    color: #94a3b8;
}

.link-danger {
    color: #dc2626;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.link-danger:hover {
    text-decoration: underline;
}

.empty {
    padding: 50px 20px;
    text-align: center;
    color: #94a3b8;
}

.empty p {
    margin-bottom: 16px;
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .nav-user {
        display: none;
    }
    .nav-links {
        gap: 12px;
    }
}



/* ===== Step 4 additions ===== */
.btn-light {
    background: #f1f5f9;
    color: #475569;
}

.btn-light:hover {
    background: #e2e8f0;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.inline-form {
    display: flex;
    gap: 12px;
}

.inline-form input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.inline-form input[type="text"]:focus {
    border-color: #6366f1;
}

@media (max-width: 600px) {
    .inline-form {
        flex-direction: column;
    }
}

/* ===== Charts ===== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.chart-panel {
    display: flex;
    flex-direction: column;
}

.chart-box {
    padding: 20px;
    height: 300px;
    position: relative;
}

@media (max-width: 768px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* ===== delete button को link जैसा बनाओ ===== */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: #dc2626;
    font-size: 13px;
    font-weight: 600;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ===== Dashboard filter ===== */
.filter-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.filter-group select {
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.filter-group select:focus {
    border-color: #6366f1;
}

@media (max-width: 600px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group select {
        width: 100%;
    }
}


/* ===== Action buttons (Edit / Delete) ===== */
.action-btns {
    display: inline-flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Edit — हल्का बैंगनी button */
.link-edit {
    display: inline-block;
    padding: 6px 14px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e0e7ff;
    transition: background 0.15s;
}

.link-edit:hover {
    background: #e0e7ff;
}

/* Delete — हल्का लाल button (link नहीं, असल button) */
.btn-link {
    padding: 6px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-link:hover {
    background: #fee2e2;
}