:root {
    /* Brand Colors */
    --primary: #2563eb;
    /* Royal Blue 600 */
    --primary-hover: #1d4ed8;
    /* Royal Blue 700 */
    --secondary: #6366f1;
    /* Soft Purple 500 */

    /* Backgrounds */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --sidebar-bg: #1e3a8a;
    /* Brand 900 (Dark Blue) */
    --card-bg: #ffffff;

    /* Text */
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #f1f5f9;
    /* Slate 100 (for sidebar) */

    /* Borders */
    --border-color: #e2e8f0;

    /* Status */
    --success: #10B981;
    --danger: #EF4444;
}

* {
    box_sizing: border_box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* LOGIN / REGISTER PAGE STYLES (Centered) */
body:not(.dashboard-body) {
    justify-content: center;
    align-items: center;
}

body:not(.dashboard-body) .container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

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

/* --- SIDEBAR LAYOUT --- */

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.sidebar-brand {
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    color: #bfdbfe;
    /* Brand 200 */
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.user-profile {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logout-btn {
    color: #fca5a5;
    font-size: 0.875rem;
    cursor: pointer;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    padding: 2rem;
    width: calc(100% - 260px);
}

/* Card & General UI */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

h2,
h3 {
    color: var(--text-main);
    font-weight: 700;
}

h2 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: #fff;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    ring: 2px solid var(--secondary);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.btn:hover {
    background-color: var(--primary-hover);
}

/* Lists */
.list-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.list-item {
    background: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-item:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background: #dcfce7;
    color: #15803d;
}

.badge-red {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-yellow {
    background: #fef9c3;
    color: #a16207;
}

/* Tabs (Client Detail) */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}