:root {
    --bg-dark: #0f111a;
    --panel-bg: rgba(255, 255, 255, 0.03);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent: #6b4cff;
    --accent-hover: #8367ff;
    --text-main: #f0f2f8;
    --text-muted: #8b92a5;
    
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Subtle background glow effects */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(107, 76, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
}

.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #4a30cc 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(107, 76, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 76, 255, 0.4);
    background: linear-gradient(135deg, var(--accent-hover) 0%, #5b40e6 100%);
}

.btn-primary.full-width {
    width: 100%;
}

.btn-icon {
    background: transparent;
    color: var(--text-main);
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 8px;
}

.btn-icon:hover {
    background: var(--panel-border);
}

/* Auth Box */
.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.cube-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    border-radius: 8px;
    transform: rotate(45deg);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.5);
}

.cube-logo.small {
    width: 24px;
    height: 24px;
}

.tabs {
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 12px;
}

.tabs button {
    flex: 1;
    padding: 10px;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
}

.tabs button.active {
    background: var(--panel-border);
    color: var(--text-main);
}

input, select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

#auth-form, #record-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
    min-height: 20px;
}

/* Dashboard Layout */
#dashboard-screen {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    gap: 24px;
}

.sidebar {
    width: 260px;
    height: calc(100vh - 48px);
    position: sticky;
    top: 24px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
}

.sidebar nav {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(107, 76, 255, 0.1);
    color: var(--accent);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--panel-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.user-profile .info h4 {
    font-size: 0.9rem;
}
.user-profile .info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Main Content */
.main-content {
    flex: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 4px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.glass-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.05);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info h2 {
    font-size: 1.8rem;
    margin-top: 4px;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--panel-border);
}

.table-container {
    padding: 0 24px 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px 8px;
    border-bottom: 1px solid var(--panel-border);
}

td {
    padding: 16px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-income { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.status-expense { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Side panel bars */
.side-panel {
    padding: 24px;
}

.side-panel h3 {
    margin-bottom: 24px;
}

.bars-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bar-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.bar-track {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 32px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}
