/**
 * Hospital Appointment Queue Management System
 * Core Application Stylesheet: app.css
 * Clean, Clinical & Professional Solid Healthcare Design System
 */

:root {
    /* Color Palette - Solid Clinical Theme (Strictly NO Gradients) */
    --color-sidebar: #0f172a;        /* Deep Slate 900 */
    --color-sidebar-surface: #1e293b;/* Slate 800 */
    --color-sidebar-hover: #334155;  /* Slate 700 */
    --color-sidebar-text: #94a3b8;   /* Slate 400 */
    --color-sidebar-active: #ffffff;
    --color-sidebar-accent: #0d9488; /* Clinical Teal 600 */

    --color-primary: #0d9488;        /* Teal 600 */
    --color-primary-hover: #0f766e;  /* Teal 700 */
    --color-primary-light: #f0fdfa;  /* Teal 50 */
    
    --color-secondary: #475569;      /* Slate 600 */
    --color-body-bg: #f8fafc;        /* Slate 50 */
    --color-card-bg: #ffffff;
    --color-border: #e2e8f0;         /* Slate 200 */
    --color-border-dark: #cbd5e1;    /* Slate 300 */
    
    --color-text-main: #0f172a;      /* Slate 900 */
    --color-text-muted: #64748b;     /* Slate 500 */
    --color-text-light: #94a3b8;     /* Slate 400 */

    --color-success: #16a34a;        /* Green 600 */
    --color-warning: #d97706;        /* Amber 600 */
    --color-danger: #dc2626;         /* Red 600 */
    --color-info: #0284c7;           /* Sky 600 */

    /* Typography & Sizing */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width-expanded: 260px;
    --sidebar-width-collapsed: 74px;
    --topbar-height: 64px;
    --transition-speed: 0.25s;
    --border-radius-base: 8px;
    --border-radius-card: 10px;
}

/* Global Reset & Typography */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-base);
    background-color: var(--color-body-bg);
    color: var(--color-text-main);
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Layout Structure
   -------------------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width-expanded);
    min-width: var(--sidebar-width-expanded);
    background-color: var(--color-sidebar);
    color: var(--color-sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed) ease, min-width var(--transition-speed) ease;
    z-index: 1040;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--color-sidebar-surface);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.sidebar-brand i {
    color: var(--color-sidebar-accent);
    font-size: 1.4rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.sidebar-menu {
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
    flex: 1;
}

.sidebar-menu .menu-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
    white-space: nowrap;
}

.sidebar-menu .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: var(--color-sidebar-text);
    border-radius: var(--border-radius-base);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.sidebar-menu .nav-link i {
    font-size: 1.15rem;
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu .nav-link:hover {
    background-color: var(--color-sidebar-surface);
    color: var(--color-sidebar-active);
}

.sidebar-menu .nav-link.active {
    background-color: var(--color-sidebar-accent);
    color: #ffffff;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-sidebar-surface);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Sidebar Collapsed State (Desktop) */
body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-width-collapsed);
    min-width: var(--sidebar-width-collapsed);
}

body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .sidebar-menu .menu-header,
body.sidebar-collapsed .sidebar-menu .nav-label,
body.sidebar-collapsed .sidebar-footer .footer-text {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .sidebar-brand i {
    margin-right: 0;
}

body.sidebar-collapsed .sidebar-menu .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

body.sidebar-collapsed .sidebar-menu .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-width-collapsed);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width-expanded);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease;
    background-color: var(--color-body-bg);
}

/* Topbar Styling */
.app-topbar {
    height: var(--topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-base);
    color: var(--color-secondary);
    padding: 0.35rem 0.65rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background-color: #f1f5f9;
    color: var(--color-text-main);
}

.topbar-breadcrumb {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.topbar-breadcrumb .active {
    color: var(--color-text-main);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* User Profile Badge in Topbar */
.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 0.35rem 0.75rem;
    border-radius: 30px;
    text-decoration: none;
    color: var(--color-text-main);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.user-dropdown-btn:hover {
    background-color: #f8fafc;
    border-color: var(--color-border-dark);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--color-sidebar-surface);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #475569;
    border: 3px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Content Container */
.app-content {
    flex: 1;
    padding: 1.75rem;
}

/* Footer Styling */
.app-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--color-border);
    padding: 0.85rem 1.75rem;
    font-size: 0.825rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Component Styles (Solid & Professional)
   -------------------------------------------------------------------------- */
.card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-card);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.card-body {
    padding: 1.25rem;
}

/* Stat Widgets */
.stat-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-radius: var(--border-radius-card);
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    height: 100%;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background-color: #f0fdfa;
    color: var(--color-primary);
}

.stat-icon.info {
    background-color: #f0f9ff;
    color: var(--color-info);
}

.stat-icon.success {
    background-color: #f0fdf4;
    color: var(--color-success);
}

.stat-icon.warning {
    background-color: #fffbeb;
    color: var(--color-warning);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Buttons - Solid, Clean, Flat */
.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    font-weight: 500;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-primary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

/* Role Badges */
.badge-role {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-role-admin {
    background-color: #ede9fe;
    color: #6d28d9;
}

.badge-role-doctor {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-role-receptionist {
    background-color: #fef3c7;
    color: #b45309;
}

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

/* Auth Portal View (Login) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 2.25rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand-icon {
    width: 54px;
    height: 54px;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

/* Mobile Responsiveness & Drawer */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-main {
        margin-left: 0 !important;
    }
}
