@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

/* ── Font & Enterprise Design Variables ───────────────────────────────────── */
:root {
    --font-heading: "Manrope", sans-serif;
    --font-body: "Inter", sans-serif;
    
    --primary: #00652c;
    --primary-container: #15803d;
    --primary-fixed-dim: #79db8d;
    --on-primary: #ffffff;
    
    --bg-main: transparent;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-card: rgba(255, 255, 255, 0.9);
    --surface-container: #eceef0;
    --surface-container-low: rgba(242, 244, 246, 0.75);
    
    --border-color: #becabc;
    --border-light: #e0e3e5;
    
    --text-primary: #191c1e;
    --text-secondary: #565e74;
    --text-muted: #6f7a6e;
    
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --error: #ba1a1a;
    --error-container: #ffdad6;
    --on-error-container: #93000a;
    
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 12px 20px -3px rgba(0, 0, 0, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: transparent;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Official ITZ4U Tricolour Ambient Background Throughout */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background-image: url('assets/bg_wave.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0.9;
}

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

/* ══════════════════════════════════════════════════════
   ENTERPRISE SIDEBAR & WORKSPACE LAYOUT
══════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    background: transparent;
    position: relative;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────── */
.app-sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    margin-bottom: 32px;
    padding: 0 6px;
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand .brand-logo {
    height: 38px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 16px;
    color: var(--primary);
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.sidebar-nav .nav-item:hover {
    background: rgba(0, 101, 44, 0.06);
    color: var(--text-primary);
}

.sidebar-nav .nav-item.active {
    background: #e8f5e9;
    color: var(--primary);
}

.sidebar-nav .nav-item .material-symbols-outlined {
    font-size: 20px;
}

.sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 101, 44, 0.25);
    transition: all 0.2s ease;
}

.sidebar-action-btn:hover {
    background: var(--primary-container);
    transform: translateY(-1px);
}

.sidebar-footer-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.sidebar-link-btn:hover {
    background: rgba(0, 101, 44, 0.06);
    color: var(--text-primary);
}

/* ── Main Content Area ───────────────────────────────── */
.app-main {
    margin-left: 250px;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: calc(100% - 250px);
    background: transparent;
    overflow-y: auto;
    overflow-x: hidden;
}

.top-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 32px;
    height: 52px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    z-index: 90;
    gap: 16px;
    box-sizing: border-box;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px;
}

.mobile-sidebar-close {
    display: none;
    align-self: flex-end;
    width: 40px;
    height: 40px;
    margin: -10px -8px 8px 0;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-secondary);
    cursor: pointer;
}

.top-search-box {
    position: relative;
    max-width: 380px;
    width: 100%;
}

.top-search-box input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    background: rgba(242, 244, 246, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.top-search-box input:focus {
    background: #ffffff;
    border-color: var(--primary-container);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.top-search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}

.top-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 7px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

.top-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.top-action-btn.primary {
    background: #e8f5e9;
    border-color: var(--border-color);
    color: var(--primary);
}

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

/* Dashboard guidance uses the same Inter type scale as the rest of the portal. */
.top-hint-pill {
    display: flex;
    align-items: center;
    flex-direction: row;
    flex: 1 1 auto;
    width: 100%;
    max-width: 680px;
    min-width: 0;
    padding: 8px 14px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    color: #14532d;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.top-hint-pill .material-symbols-outlined {
    flex-shrink: 0;
}

.top-hint-icon {
    margin-right: 8px;
    color: var(--primary-container);
    font-size: 18px;
    flex-shrink: 0;
}

.top-hint-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    color: #14532d;
    font-weight: 600;
}

.top-hint-text a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.top-hint-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}

.top-hint-next:hover,
.top-hint-next:focus-visible {
    background: #dcfce7;
    outline: none;
}

.top-hint-next .material-symbols-outlined {
    font-size: 18px;
}

/* Mobile Hint Icon Button */
.mobile-hint-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mobile-hint-btn:active {
    transform: scale(0.92);
    background: #dcfce7;
}

/* Developer Switch */
.dev-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(242, 244, 246, 0.8);
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
}

.dev-switch-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.dev-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}

.dev-switch input {
    opacity: 0;
    width: 0; height: 0;
}

.dev-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: 0.25s ease;
    border-radius: 18px;
}

.dev-slider:before {
    position: absolute;
    content: "";
    height: 14px; width: 14px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: 0.25s ease;
    border-radius: 50%;
}

.dev-switch input:checked + .dev-slider {
    background-color: var(--primary-container);
}

.dev-switch input:checked + .dev-slider:before {
    transform: translateX(16px);
}

.dev-role-text {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
}

/* ── Workspace Body ───────────────────────────────────── */
.workspace-body {
    padding: 16px 32px 24px 32px;
    flex: 1;
    flex-shrink: 0;
    min-height: min-content;
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.workspace-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 2px 0;
    letter-spacing: -0.02em;
    text-align: left;
}

.workspace-title span {
    color: var(--primary-container);
}

.workspace-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    text-align: left;
}

.admin-badge-pill {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── 2x2 Enterprise Cards Grid ───────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    flex: 1;
    min-height: 0;
}

.enterprise-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
}

.enterprise-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.95);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon-box.green {
    background: #e8f5e9;
    color: var(--primary);
}

.status-pill {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.status-pill.live {
    background: #dcfce7;
    color: #16a34a;
}

.status-pill.subtle {
    background: rgba(242, 244, 246, 0.8);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-heading {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.card-subtext {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 12px 0;
    flex: 1;
}

.card-footer-action {
    margin-top: auto;
    display: flex;
}

.btn-card-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-card-open:hover {
    border-color: var(--primary-container);
    color: var(--primary-container);
    background: #e8f5e9;
}

/* Service Down Banner */
.service-down-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #93000a;
    color: #ffffff;
    padding: 12px 24px;
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 16px;
}

.service-down-title { font-weight: 700; font-size: 14px; }
.service-down-msg { font-size: 12.5px; opacity: 0.9; }
.service-down-btn { padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; text-decoration: none; }
.service-down-btn.whatsapp { background: #25d366; color: #fff; }
.service-down-btn.email { background: rgba(255,255,255,0.2); color: #fff; }
.service-down-dismiss { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: var(--font-body);
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.toast-notification.toast-error   { border-left-color: var(--danger); }
.toast-notification.toast-success { border-left-color: #16a34a; }

.toast-notification-body { flex: 1; }
.toast-notification-title { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; color: var(--text-primary); }
.toast-notification-msg   { color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

.toast-notification-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 18px; line-height: 1;
}

/* Modals */
.modal-overlay, .modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-overlay.open, .modal-overlay.active, .modal-backdrop.active {
    display: flex !important;
}

.modal-content, .modal-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.modal-content h2, .modal-card .modal-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.modal-content p, .modal-card .modal-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    box-sizing: border-box;
}

.modal-input:focus {
    border-color: var(--primary-container);
    box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-btn.cancel {
    flex: 1;
    padding: 10px 16px;
    background: var(--surface-container-low);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

.modal-btn.confirm, .modal-btn {
    flex: 1;
    padding: 10px 16px;
    background: var(--primary-container);
    color: #ffffff;
    border: 1px solid var(--primary-container);
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

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

/* Profile Popup at Sidebar Account Button */
.profile-popup {
    position: fixed;
    bottom: 80px;
    left: 18px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.profile-popup h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 12px 0;
}

.profile-popup p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

/* Akshath Socials Hover popover */
.akshath-author {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.akshath-name {
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}

.akshath-socials {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    padding-bottom: 8px;
    z-index: 100;
}

.akshath-socials::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 14px;
}

.akshath-author:hover .akshath-socials,
.akshath-socials:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.akshath-socials-inner {
    display: flex;
    flex-direction: row;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.akshath-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    color: var(--text-primary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.akshath-card svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.akshath-card.github:hover { color: #000000; transform: scale(1.1); }
.akshath-card.linkedin:hover { color: #0a66c2; transform: scale(1.1); }

/* Site Footer */
.site-footer {
    width: 100%;
    flex-shrink: 0;
    padding: 10px 32px;
    border-top: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    font-size: 12.5px;
    color: var(--text-secondary);
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* ── Success Toast Overlay (full-screen modal style) ─── */
.toast-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 99990;
    padding: 20px;
}

.toast-overlay.active {
    display: flex !important;
}

.toast-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.18);
    text-align: center;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-card .toast-icon {
    font-size: 44px;
    display: block;
    margin-bottom: 16px;
}

.toast-body { text-align: left; margin-bottom: 20px; }
.toast-title { font-weight: 800; font-size: 17px; margin-bottom: 6px; color: var(--text-primary); }
.toast-msg   { color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

.toast-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-container);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toast-btn:hover { background: var(--primary); }
.toast-btn-top   { font-size: 14px; }

@keyframes toastIn {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.9) translateY(8px); }
}
@keyframes toastOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(120%); }
}

/* ── Tour Replay Floating Button ─────────────────────── */
.tour-replay-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary-container);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 9000;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tour-replay-btn:hover {
    background: var(--primary);
    transform: scale(1.04);
}

/* ── Tour Tooltip & Backdrop ─────────────────────────── */
.tour-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 9900;
    pointer-events: none;
}

.tour-backdrop.active { display: block; }

.tour-tooltip {
    display: none;
    position: absolute;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.18);
    z-index: 10000;
    pointer-events: auto;
}

.tour-tooltip.active { display: block; }

.tour-tooltip-arrow {
    position: absolute;
    width: 0; height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.tour-tooltip-arrow.arrow-top {
    top: -8px; left: 50%; transform: translateX(-50%);
    border-bottom: 8px solid #ffffff;
}

.tour-tooltip-arrow.arrow-bottom {
    bottom: -8px; left: 50%; transform: translateX(-50%);
    border-top: 8px solid #ffffff;
}

.tour-tooltip-title { font-weight: 800; font-size: 15px; margin-bottom: 8px; color: var(--text-primary); }
.tour-tooltip-text  { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }

.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-tooltip-steps { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.tour-tooltip-btns  { display: flex; gap: 8px; }

.tour-tooltip-btn {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}

.tour-tooltip-btn.next {
    background: var(--primary-container);
    color: #ffffff;
}

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

.tour-tooltip-btn.skip {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

.tour-tooltip-btn.skip:hover { background: rgba(0, 0, 0, 0.1); }

.tour-highlighted {
    position: relative;
    z-index: 9950;
    box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.5), 0 0 0 8px rgba(0, 180, 216, 0.15) !important;
    border-radius: 12px;
}

/* ── Onboarding Tour Overlay & Tooltips ───────────────── */
.tour-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.tour-overlay.active {
    display: flex !important;
}

.tour-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    text-align: center;
    position: relative;
}

.tour-card .toast-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

.tour-card .tour-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.tour-card .tour-msg {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 24px 0;
}

.tour-btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-container);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s ease;
}

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

.tour-btn-secondary {
    width: 100%;
    padding: 10px;
    background: none;
    color: var(--text-secondary);
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.tour-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 12.5px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
}

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

@media (max-width: 992px) {
    html, body, .app-layout, .app-main {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .app-sidebar {
        width: min(280px, 86vw);
        transform: translateX(-105%);
        box-shadow: 12px 0 30px rgba(15, 23, 42, 0.18);
    }
    .app-sidebar.active {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
        width: 100%;
    }
    .mobile-nav-toggle {
        display: block;
    }
    .mobile-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .card-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
    }
    .top-header-bar {
        padding: 16px 20px;
    }
    .top-hint-pill {
        max-width: none;
    }
    .workspace-body {
        padding: 18px 14px;
        overflow: visible !important;
        height: auto !important;
        min-height: 100% !important;
    }
}

@media (max-width: 640px) {
    .top-header-bar {
        height: auto;
        min-height: 60px;
        padding: 8px 12px;
        gap: 8px;
    }
    .mobile-nav-toggle,
    .icon-btn {
        min-width: 40px;
        min-height: 40px;
    }
    .top-header-actions { gap: 6px; }
    .top-hint-pill {
        display: none !important;
    }
    .mobile-hint-btn {
        display: flex !important;
    }
    .workspace-body { padding: 16px 12px; }
    .workspace-header {
        align-items: flex-start;
        gap: 12px;
    }
    .workspace-title { font-size: 21px; }
    .workspace-desc { font-size: 12.5px; line-height: 1.5; }
    .enterprise-card {
        padding: 18px 16px !important;
        min-height: 160px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .card-heading { font-size: 17px; }
    .btn-card-open {
        min-height: 42px;
        justify-content: center;
        width: 100% !important;
    }
    #admin-analytics-banner {
        padding: 16px 14px !important;
        border-radius: 14px !important;
    }
    #admin-analytics-banner .admin-banner-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .site-footer { padding: 12px 16px; }
    .footer-container {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 6px;
    }
    .footer-left {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
    }
    .footer-center {
        text-align: center;
        font-size: 11px;
    }
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }
    .footer-links a { font-size: 11.5px; }
    .modal-content,
    .modal-card {
        width: calc(100vw - 28px);
        padding: 20px;
    }
    .toast-container {
        top: auto;
        right: 14px;
        bottom: 14px;
        left: 14px;
    }
    .toast-notification { min-width: 0; max-width: none; }
}

/* Allow admin overview card to expand without clipping graph elements */
#status-card-parent {
    overflow: visible !important;
}
