:root {
    /* Microsoft Admin Portal Aesthetic */
    --primary: #0078d4;
    --primary-hover: #106ebe;
    --bg-main: #f3f2f1;
    --bg-white: #ffffff;
    --text-main: #323130;
    --text-secondary: #605e5c;
    --border: #e1dfdd;
    --border-hover: #8a8886;
    --success: #107c10;
    --warning: #fff100;
    --danger: #a4262c;

    --sidebar-width: 240px;
    --header-height: 48px;
    --radius: 2px;
    /* Microsoft uses very small radii */
    --shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#app-container {
    display: none;
    /* Hidden until login */
    height: 100vh;
    width: 100vw;
}

#app-container.active {
    display: flex;
}

/* --- LOGIN SCREEN --- */
#login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 44px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--text-secondary);
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: var(--bg-white);
    border: 1px solid var(--border);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

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

/* --- SIDEBAR --- */
#sidebar {
    width: var(--sidebar-width);
    background: #201f1e;
    color: var(--bg-white);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    /* Enable vertical scroll */
    z-index: 100;
}

.logo-section {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--bg-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links {
    list-style: none;
    padding: 12px 0;
}

.nav-category {
    padding: 16px 24px 8px 24px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a19f9d;
    letter-spacing: 0.1em;
}

.nav-links li {
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #c8c6c4;
    transition: all 0.2s;
}

.nav-links li:hover {
    background: #292827;
    color: var(--bg-white);
}

.nav-links li.active {
    background: #edebe9;
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

/* --- MAIN CONTENT --- */
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-selector {
    padding: 4px 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
}

.client-selector:hover {
    background: #f3f2f1;
}

#view-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* --- CARDS & GRID --- */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.card:hover {
    border-color: var(--border-hover);
}

.grid {
    display: grid;
    gap: 20px;
}

/* --- UTILS --- */
.hidden {
    display: none !important;
}

/* Status Pills */
.status-pill {
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
}

.status-success {
    background: #dff6dd;
    color: #107c10;
}

.status-warning {
    background: #fff4ce;
    color: #797775;
}

.status-danger {
    background: #fde7e9;
    color: #a4262c;
}

/* Calendar styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid var(--border);
    padding: 4px;
    font-size: 0.7rem;
    background: var(--bg-white);
}

.calendar-day.has-tasks {
    background: #eff6fc;
}

.calendar-day.today {
    border: 2px solid var(--primary);
}

@media (max-width: 768px) {
    #sidebar {
        display: none;
    }

    .nav-mobile {
        display: flex;
    }
}