
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ────────────────────────────── CSS CUSTOM PROPERTIES ────────────────────────────── */
:root {
    --color-primary: #2b4656;
    --color-primary-hover: #98CA43;
    --color-success: #98CA43;
    --color-danger: #b84040;
    --color-warning: #c9745e;
    --color-view: #3b5998;
    --color-edit: #c9745e;
    --color-bg: #fdfdfd;
    --color-surface: #ffffff;
    --color-text: #111111;
    --color-subtitle: #525252;
    --color-muted: #6b7280;
    --color-border: #d1d5db;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --shadow-focus: 0 0 0 3px rgba(23, 37, 84, 0.2);
    --transition: all 0.2s ease;
}

/* ────────────────────────────── GLOBAL RESET & BASE ────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
}

/* ─────────────────────── LOGIN PAGE ─────────────────────── */
.login-page-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 3rem 2.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg),
                inset 0 1px 0 rgba(255,255,255,0.8);
    text-align: center;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
}

.login-subtitle {
    color: var(--color-subtitle);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

.login-btn--microsoft {
    display: inline-block;
    padding: 0.875rem 2.25rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.login-btn--microsoft:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.login-disclaimer {
    margin-top: 2.5rem;
    font-size: 0.75rem;
    color: var(--color-muted);
    line-height: 1.4;
}

/* ─────────────────────── DASHBOARD LAYOUT ─────────────────────── */
.dash-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--color-bg);
}

.dash-sidebar {
    position: fixed;
    inset: 0 0 0 0;
    width: 260px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    transition: width 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.dash-sidebar--collapsed {
    width: 65px;
}

.dash-sidebar--collapsed .dash-sidebar__label,
.dash-sidebar--collapsed .dash-user__name {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

/* Logo */
.dash-sidebar__logo {
    width: 36px;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    margin: 0 auto;
    transition: width 0.3s ease;
    border-bottom: none;
}

.dash-sidebar__logo img {
    width: 100%;
    height: auto;
    display: block;
    transition: width 0.3s ease;
}

.dash-sidebar:not(.dash-sidebar--collapsed) .dash-sidebar__logo {
    width: 100px;
}

/* Navigation */
.dash-nav {
    flex: 1;
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.dash-nav__item { margin-bottom: 0.25rem; }

.dash-nav__link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.dash-nav__link:hover,
.dash-nav__link--active {
    background: rgba(23, 37, 84, 0.12);
    color: var(--color-primary);
    font-weight: 500;
}

/* Icons */
.dash-nav__icon {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-nav__icon svg {
    stroke: var(--color-text);
    stroke-width: 2;
}

.dash-nav__link:hover .dash-nav__icon svg,
.dash-nav__link--active .dash-nav__icon svg {
    stroke: var(--color-primary);
}

.dash-sidebar__logout .dash-nav__link:hover .dash-nav__icon svg {
    stroke: #842029;
}

.dash-sidebar--collapsed .dash-nav__icon {
    font-size: 1.6rem;
    margin-right: 0;
}

/* User profile row */
.dash-nav__item--user {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.dash-nav__item--user .dash-nav__link {
    font-weight: 500;
    color: var(--color-text);
}

.dash-nav__item--user .dash-nav__link:hover {
    background: rgba(23, 37, 84, 0.12);
    color: var(--color-primary);
}

/* Logout */
.dash-sidebar__logout {
    border-top: 1px solid var(--color-border);
}

.dash-sidebar__logout .dash-nav__link:hover {
    background: var(--color-danger);
    color: #842029 !important;
}

/* Toggle button */
.dash-sidebar__toggle {
    position: absolute;
    top: 1.5rem;
    right: -12px;
    width: 32px;
    height: 32px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-muted);
}

.dash-sidebar__toggle:hover {
    background: #f5f5f5;
}

/* Main content area */
.dash-main {
    margin-left: 260px;
    padding: 3rem 2rem;
    flex: 1;
    min-height: 100vh;
    background: var(--color-bg);
    transition: margin-left 0.3s ease;
}

.dash-sidebar--collapsed ~ .dash-main {
    margin-left: 65px;
}

/* Welcome text */
.dash-main > h1 {
    text-align: center;
    font-size: 2.4rem;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
}

.dash-main > p:first-of-type {
    text-align: center;
    color: var(--color-subtitle);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.dash-container {
    max-width: 80vw;
    margin: 0 auto;
}

/* ─────────────────────── MOBILE ─────────────────────── */
@media (max-width: 768px) {
    .dash-sidebar {
        left: -260px;
        width: 260px;
        transition: left 0.3s ease;
    }

    .dash-sidebar:not(.dash-sidebar--collapsed) {
        left: 0;
    }

    .dash-sidebar--collapsed {
        left: -260px;
        width: 260px;
    }

    .dash-main {
        margin-left: 0;
        padding: 2rem 1rem;
        padding-top: 4rem;
    }

    .dash-sidebar--collapsed ~ .dash-main {
        margin-left: 0;
    }

    .dash-sidebar__toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        right: auto;
        z-index: 1001;
        background: var(--color-surface);
        box-shadow: var(--shadow-md);
    }

    .dash-sidebar:not(.dash-sidebar--collapsed) .dash-sidebar__toggle {
        left: 270px;
    }

    .dash-sidebar:not(.dash-sidebar--collapsed) ~ .dash-main::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }
}
