:root {
    --primary: #0056b3;
    --primary-light: #e6f0fa;
    --bg-color: #f4f7f6;
    --surface: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border: #dddddd;
    --danger: #dc3545;
    --success: #28a745;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
body { background: var(--bg-color); color: var(--text-main); line-height: 1.5; overflow-x: hidden; }

/* Utilities */
.hidden { display: none !important; }
.active { display: block; animation: fadeIn 0.2s ease-in; }
.w-100 { width: 100%; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Layouts */
.app-header { background: var(--primary); color: white; padding: 1rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.app-header h1 { font-size: 1.25rem; cursor: pointer; }
.app-container { max-width: 800px; margin: 0 auto; padding: 1rem; }

/* Dashboard & Cards */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); padding: 1.25rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.stat-card h3 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-card p { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

.action-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 600px) { .action-grid { grid-template-columns: repeat(2, 1fr); } }

.card { background: var(--surface); padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.cards-container { display: flex; flex-direction: column; gap: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-weight: 600; font-size: 1.1rem; }
.card-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }
.card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }

/* Typography & Forms */
.view-title { font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--primary); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; color: var(--text-muted); }
input, textarea { width: 100%; padding: 0.8rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
input:focus, textarea:focus { border-color: var(--primary); outline: none; }
.search-bar { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }

/* Buttons */
button { cursor: pointer; border: none; font-weight: 600; border-radius: 8px; padding: 0.85rem; font-size: 1rem; }
.nav-btn { background: rgba(255,255,255,0.2); color: white; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.action-btn { background: var(--surface); color: var(--primary); padding: 1.25rem; font-size: 1.1rem; box-shadow: var(--shadow); border: 1px solid var(--primary-light); }
.primary-btn { background: var(--primary); color: white; }
.secondary-btn { background: #e0e0e0; color: var(--text-main); }
.danger-btn { background: var(--danger); color: white; }
.success-btn { background: var(--success); color: white; }

/* Auth Layout */
.login-header { text-align: center; margin: 3rem 0 2rem 0; }
.login-logo { width: 80px; height: 80px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 1rem; font-weight: bold; box-shadow: 0 4px 10px rgba(0,86,179,0.3); }
.login-title { color: var(--primary); font-size: 1.5rem; font-weight: 700; }
.auth-links { margin-top: 1rem; text-align: center; }
.primary-link { color: var(--primary); text-decoration: none; font-weight: 500; display: block; margin-bottom: 0.5rem; }
.muted-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 20; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--surface); width: 90%; max-width: 400px; padding: 1.5rem; border-radius: var(--radius); z-index: 30; }
.modal h3 { color: var(--primary); margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.modal-actions button { flex: 1; }
.modal-actions-col { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.warning-text { color: var(--danger); font-size: 0.85rem; margin: 0.5rem 0 1.5rem; }
.details-grid p { margin-bottom: 0.75rem; border-bottom: 1px solid var(--bg-color); padding-bottom: 0.5rem; }
.details-grid strong { color: var(--text-muted); font-size: 0.85rem; display: block; }

/* Billing & Footer */
.app-footer { text-align: center; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-muted); }
.bill-container { border: 1px dashed var(--border); padding: 1rem; background: #fafafa; border-radius: 8px; margin-bottom: 1rem; }
.bill-header { text-align: center; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.bill-header h4 { color: var(--primary); margin: 0; }
.bill-row { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.95rem; align-items: center; }
.bill-total { display: flex; justify-content: space-between; font-weight: 700; margin-top: 0.75rem; border-top: 1px solid var(--border); padding-top: 0.75rem; color: var(--primary); font-size: 1.1rem; }
.mini-btn { background: none; color: var(--danger); font-size: 1rem; padding: 0 4px; }