* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* Login */
#login-screen { display: flex; align-items: center; justify-content: center; }

.login-card {
    text-align: center; padding: 3rem;
    background: #161b22; border-radius: 12px; border: 1px solid #30363d;
}
.login-card h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #58a6ff; }
.login-card p { color: #8b949e; margin-bottom: 2rem; }

/* Nav */
nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 2rem; background: #161b22; border-bottom: 1px solid #30363d;
}
nav h2 { color: #58a6ff; font-size: 1.2rem; }

.nav-tabs { display: flex; gap: 0.5rem; }

.tab {
    background: transparent; color: #8b949e; border: none;
    padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem;
}
.tab.active { background: #21262d; color: #e1e4e8; }
.tab:hover { color: #e1e4e8; }

.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-right span { color: #8b949e; }
.nav-right button {
    background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
    padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer;
}
.nav-right button:hover { background: #30363d; }

/* Notification bell */
.notif-btn {
    position: relative; background: transparent !important; border: none !important;
    font-size: 1.2rem; cursor: pointer; padding: 0.3rem 0.5rem !important;
}
.notif-badge {
    position: absolute; top: -2px; right: -4px;
    background: #f85149; color: #fff; font-size: 0.65rem; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* Main */
main { padding: 2rem; max-width: 1200px; margin: 0 auto; }

/* Net Worth */
.net-worth-card {
    background: linear-gradient(135deg, #1a2332, #161b22);
    border: 1px solid #30363d; border-radius: 12px;
    padding: 2.5rem; text-align: center; margin-bottom: 2rem;
}
.nw-label { display: block; color: #8b949e; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }
.nw-value { display: block; font-size: 3rem; font-weight: 700; color: #58a6ff; }

/* Section header */
.section-header { margin-bottom: 1rem; }
.section-header h3 { color: #e1e4e8; font-size: 1.1rem; }

/* Accounts grid */
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 2rem; }

.account-card {
    background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1.5rem;
}
.account-name { color: #8b949e; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.account-balance { font-size: 1.6rem; font-weight: 600; margin-top: 0.3rem; }
.balance-positive { color: #3fb950; }
.balance-negative { color: #f85149; }
.balance-zero { color: #8b949e; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card {
    background: #161b22; border: 1px solid #30363d; border-radius: 8px;
    padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.card-label { color: #8b949e; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 1.8rem; font-weight: 600; color: #e1e4e8; }

/* Controls */
.controls { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.controls select, .controls button {
    background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
    padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer;
}

/* Grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .grid { grid-template-columns: 1fr; } }

/* Panels */
.panel { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1.5rem; }
.panel.full-width { margin-bottom: 1.5rem; }
.panel h3 { color: #58a6ff; margin-bottom: 1rem; font-size: 1rem; }

/* Data list */
.data-list { display: flex; flex-direction: column; gap: 0.6rem; }
.data-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #21262d; }
.data-row:last-child { border-bottom: none; }
.data-label { color: #c9d1d9; }
.data-value { color: #58a6ff; font-weight: 600; }
.data-sub { color: #8b949e; font-size: 0.85rem; margin-left: 0.5rem; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 2px solid #30363d; color: #8b949e; font-size: 0.85rem; text-transform: uppercase; }
td { padding: 0.7rem 0.5rem; border-bottom: 1px solid #21262d; color: #c9d1d9; }
td select {
    background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
    padding: 0.3rem 0.5rem; border-radius: 4px; cursor: pointer;
}
.amount-debit { color: #f85149; }
.amount-credit { color: #3fb950; }

/* Role badge */
.role-badge {
    padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.role-admin { background: #58a6ff22; color: #58a6ff; }
.role-member { background: #8b949e22; color: #8b949e; }

/* Small button */
.btn-small {
    background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
    padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem;
}
.btn-small:hover { background: #30363d; }

/* Notifications */
.notif-card {
    background: #161b22; border: 1px solid #30363d; border-radius: 8px;
    padding: 1rem 1.5rem; margin-bottom: 0.75rem; cursor: pointer; transition: border-color 0.2s;
}
.notif-card:hover { border-color: #58a6ff; }
.notif-unread { border-left: 3px solid #58a6ff; }
.notif-read { opacity: 0.6; }
.notif-title { font-weight: 600; margin-bottom: 0.3rem; }
.notif-message { color: #c9d1d9; font-size: 0.9rem; margin-bottom: 0.3rem; }
.notif-time { color: #8b949e; font-size: 0.75rem; }

/* Action buttons */
.actions-cell { white-space: nowrap; }
.btn-icon {
    background: transparent; border: none; cursor: pointer;
    font-size: 1rem; padding: 0.3rem 0.5rem; border-radius: 4px; color: #8b949e;
}
.btn-icon:hover { background: #21262d; color: #e1e4e8; }
.btn-danger:hover { color: #f85149; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-content {
    position: relative; background: #161b22; border: 1px solid #30363d; border-radius: 12px;
    padding: 2rem; width: 90%; max-width: 480px; z-index: 1;
}
.modal-content h3 { color: #58a6ff; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; color: #8b949e; font-size: 0.8rem; margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select {
    width: 100%; background: #0d1117; color: #e1e4e8; border: 1px solid #30363d;
    padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 0.9rem;
}
.form-group input:focus, .form-group select:focus { border-color: #58a6ff; outline: none; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
.btn-primary {
    background: #238636; color: #fff; border: none;
    padding: 0.5rem 1.2rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.btn-primary:hover { background: #2ea043; }

.empty-msg { color: #8b949e; text-align: center; padding: 2rem; }
