
@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;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─────────────────────── 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 {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.dash-sidebar__logo img {
    max-height: 48px;
    transition: max-height 0.3s ease;
}

.dash-sidebar--collapsed .dash-sidebar__logo img {
    max-height: 36px;
}

/* 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); /* primary tint */
    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-sidebar--collapsed .dash-nav__icon {
    font-size: 1.6rem;
    margin-right: 0;
}

/* User profile row */
.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,
.user-form-wrapper {
    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,
.dash-sidebar--collapsed ~ .user-form-wrapper {
    margin-left: 65px;
}

/* Mobile sidebar - collapsed by default, overlay when open */
@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,
    .user-form-wrapper {
        margin-left: 0;
        padding: 2rem 1rem;
        padding-top: 4rem;
    }

    .dash-sidebar--collapsed ~ .dash-main,
    .dash-sidebar--collapsed ~ .user-form-wrapper {
        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,
    .dash-sidebar:not(.dash-sidebar--collapsed) ~ .user-form-wrapper::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }
}

/* 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;
}

/* ─────────────────────── LOGIN / REGISTER FORM FIELDS ─────────────────────── */
.login-field {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.95rem;
}

.login-required {
    color: #dc2626;
    font-weight: 600;
}

.login-input,
.login-input:disabled {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-size: 1rem;
    transition: var(--transition);
}

.login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-focus);
}

.login-input:disabled {
    background: var(--color-bg);
    color: var(--color-muted);
    cursor: not-allowed;
    opacity: 0.85;
}

.login-error {
    background: var(--color-danger);
    color: #991b1b;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    text-align: center;
}

/* ─────────────────────── Sidebar Logo ─────────────────────── */
.dash-sidebar__logo {
    width: 60px;                /* Small collapsed – your good size */
    padding-bottom: 2rem;       /* Extra space below (prevents "pressed" feel) */
    margin: 0 auto;             /* Center */
    transition: var(--transition);
    border-bottom: none;        /* No line under logo */
}

.dash-sidebar__logo img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
    transform: scale(1);        /* Normal when collapsed */
    transform-origin: center;
}

.dash-sidebar:not(.dash-sidebar--collapsed) .dash-sidebar__logo {
    width: 120px;                /* Smaller expanded container */
}

.dash-sidebar:not(.dash-sidebar--collapsed) .dash-sidebar__logo img {
    max-height: none; /* Remove height constraint when expanded */
    transform: none;
}

/* ─────────────────────── Ticket History Header & Toggle ─────────────────────── */

.ticket-detail-history__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.ticket-detail-history__toggle-text {
    color: var(--color-primary);
    text-decoration: none;
}

.ticket-detail-history__toggle-text:hover {
    text-decoration: underline;
}