/* ============================================================
   Gateway Shell — Shared Styles
   Header, Breadcrumbs, Role Dropdown, Layout, Footer
   
   Used alongside the gateway-*.js includes.
   Sidebar styles are injected by gateway-nav.js.
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4285f4;
    --primary-dark: #3367d6;
    --primary-light: #e8f0fe;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --info: #2563eb;
    --info-bg: #eff6ff;
    --gray-50: #f8f9fa;
    --gray-100: #f0f1f3;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #1a1a2e;
    --header-height: 60px;
    --sidebar-width: 208px;
}

.material-symbols-outlined {
    font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
    vertical-align: middle;
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-900);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* ========== HEADER ========== */
.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-section svg {
    height: 32px;
    width: auto;
}

/* ========== BREADCRUMBS ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--gray-300);
}

.breadcrumb-current {
    color: var(--gray-800);
    font-weight: 500;
}

/* ========== HEADER ACTIONS ========== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.15s ease;
    position: relative;
}

.header-icon-btn:hover {
    background: var(--gray-50);
    color: var(--gray-700);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid white;
}

/* ========== USER SECTION ========== */
.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.user-section:hover {
    background: var(--gray-50);
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

/* ========== ROLE SWITCHER DROPDOWN ========== */
.role-switcher-icon {
    font-size: 18px;
    color: var(--gray-400);
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.user-section.open .role-switcher-icon {
    transform: rotate(180deg);
}

.role-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.user-section.open .role-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.role-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.role-dropdown-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.role-dropdown-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
}

.role-dropdown-email {
    font-size: 13px;
    color: var(--gray-500);
}

.role-dropdown-section {
    padding: 8px;
}

.role-dropdown-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    padding: 8px 12px 4px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.role-option:hover {
    background: var(--gray-50);
}

.role-option.active {
    background: var(--primary-light);
}

.role-option-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.role-option.active .role-option-icon {
    background: var(--primary);
    color: white;
}

.role-option-icon .material-symbols-outlined {
    font-size: 18px;
}

.role-option-info {
    flex: 1;
}

.role-option-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.role-option-desc {
    font-size: 12px;
    color: var(--gray-500);
}

.role-option-check {
    color: var(--primary);
    font-size: 20px;
    opacity: 0;
}

.role-option.active .role-option-check {
    opacity: 1;
}

.role-dropdown-footer {
    padding: 8px;
    border-top: 1px solid var(--gray-100);
}

.role-dropdown-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s ease;
}

.role-dropdown-link:hover {
    background: var(--gray-50);
}

.role-dropdown-link .material-symbols-outlined {
    font-size: 18px;
}

/* ========== MAIN LAYOUT ========== */
.main-container {
    display: flex;
    height: 100vh;
    padding-top: var(--header-height);
}

/* ========== CONTENT AREA (default) ========== */
/* Pages can override background, overflow, padding in their own <style> block */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: linear-gradient(135deg, #2d1b4e 0%, #1e3a6e 50%, #0a6b5a 100%);
    background-attachment: fixed;
}

/* ========== PAGE FOOTER ========== */
.page-footer {
    margin-top: 32px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--gray-500);
}

.page-footer a {
    color: var(--gray-500);
    text-decoration: none;
}

.page-footer a:hover {
    color: var(--primary);
}

.footer-links {
    display: flex;
    gap: 24px;
}
