/* 
    WiFi Pro - Modern Management Dashboard Styling
    Inspired by premium modern design systems.
*/

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --white: #ffffff;

    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --info: #8b5cf6;

    --sidebar-w: 260px;
    --header-h: 70px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Login Page --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -0.025em;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
}

.form-control:focus {
    background-color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

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

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-w);
    background-color: var(--secondary);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar-brand-name {
    color: white;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.sidebar-info {
    display: flex;
    flex-direction: column;
}

.sidebar-subtitle {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.nav-item i,
.nav-item svg.lucide {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

header {
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.page-title p {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

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

.user-info .name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.user-info .role {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.content-body {
    padding: 20px;
}

/* --- Dashboard Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-info .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-emerald {
    background: #ecfdf5;
    color: #10b981;
}

.icon-rose {
    background: #fff1f2;
    color: #f43f5e;
}

.icon-amber {
    background: #fffbeb;
    color: #f59e0b;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }
}

/* --- Global Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 11000;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary);
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    margin-bottom: 12px;
    min-width: 300px;
}

.toast.active {
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-danger {
    border-left-color: var(--danger);
}

.toast i {
    font-size: 20px;
}

.toast-success i {
    color: var(--success);
}

.toast-danger i {
    color: var(--danger);
}

.toast-msg {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

/* --- Notification Dropdown --- */
.notification-dropdown {
    position: absolute;
    top: 40px;
    right: -10px;
    width: 320px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    overflow: hidden;
    text-align: left;
}

.notification-dropdown.active {
    display: block;
}

.notification-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-dark);
    position: relative;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff1f2;
    color: #e11d48;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.warning {
    background: #fffbeb;
    color: #d97706;
}

.notification-icon.read {
    background: #ecfdf5;
    color: #10b981;
}

.notification-item.item-read {
    background: #fafafa;
    opacity: 0.8;
    position: relative;
}

.dismiss-btn {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
}

.notification-item:hover .dismiss-btn {
    opacity: 1;
}

.dismiss-btn:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

.notification-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    padding-right: 28px;
}

.notification-text p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   Business / Workspace Switcher (Compact)
   ======================================== */
.biz-switcher {
    --biz-accent: #2563eb;
    position: relative;
    margin-right: 8px;
}

/* Trigger button — slim icon-pill */
.biz-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 4px 10px 4px 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    line-height: 1;
}

.biz-switcher-btn:hover {
    border-color: var(--biz-accent);
    background: #fff;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.1);
}

.biz-switcher-dot {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #fff !important;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none !important;
}

.biz-switcher-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark) !important;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none !important;
    line-height: 1;
}

.biz-switcher-chev {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
    flex-shrink: 0;
}

.biz-switcher-btn:hover .biz-switcher-chev {
    background: var(--biz-accent);
    color: #fff;
    transform: rotate(180deg);
}

/* Static mode (only 1 business — no switching) */
.biz-switcher-btn-static {
    cursor: default;
    padding-right: 12px;
}
.biz-switcher-btn-static:hover {
    border-color: var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transform: none;
}

/* When the button itself is an <a> link (direct switch mode) */
a.biz-switcher-btn {
    text-decoration: none !important;
    color: var(--text-dark) !important;
}

/* ===== Dropdown Menu ===== */
.biz-switcher-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2),
                0 4px 8px -4px rgba(15, 23, 42, 0.1);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 50;
    overflow: hidden;
}

.biz-switcher-menu.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.biz-switcher-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
    z-index: 1;
}

.biz-switcher-menu-head {
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    z-index: 2;
}

.biz-switcher-menu-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.biz-switcher-menu-eyebrow {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
}

.biz-switcher-menu-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 3px 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.biz-switcher-menu-list {
    padding: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.biz-switcher-menu-list::-webkit-scrollbar { width: 6px; }
.biz-switcher-menu-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.biz-switcher-item {
    --biz-item-accent: #2563eb;
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 11px;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--text-dark) !important;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
    background: transparent;
}

.biz-switcher-item + .biz-switcher-item {
    margin-top: 2px;
}

.biz-switcher-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.biz-switcher-item.active {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.biz-switcher-item.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--biz-item-accent);
    border-radius: 0 3px 3px 0;
}

.biz-switcher-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.biz-switcher-meta strong {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-dark) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    text-decoration: none !important;
}

.biz-switcher-meta small {
    font-size: 11px;
    color: var(--text-muted) !important;
    margin-top: 2px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none !important;
}

.biz-switcher-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9.5px;
    font-weight: 800;
    color: #047857 !important;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 4px 8px 4px 6px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    line-height: 1;
}

.biz-switcher-arrow {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: all 0.2s;
}

.biz-switcher-item:hover .biz-switcher-arrow {
    background: var(--biz-item-accent);
    color: #fff;
    transform: translateX(2px);
}

/* ===== Foot link (Manage Businesses) ===== */
.biz-switcher-foot-wrap {
    padding: 6px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.biz-switcher-foot {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 11px;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--text-dark) !important;
    transition: all 0.2s;
    background: transparent;
}

.biz-switcher-foot:hover {
    background: #fff;
    box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.08);
}

.biz-switcher-foot-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #eff6ff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.biz-switcher-foot:hover .biz-switcher-foot-icon {
    background: var(--primary);
    color: #fff;
}

.biz-switcher-foot-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.biz-switcher-foot-label strong {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-dark) !important;
    text-decoration: none !important;
}

.biz-switcher-foot-label small {
    font-size: 10.5px;
    color: var(--text-muted) !important;
    margin-top: 1px;
    font-weight: 500;
    text-decoration: none !important;
}

@media (max-width: 640px) {
    .biz-switcher-name { display: none; }
    .biz-switcher-btn { padding: 4px; gap: 6px; }
    .biz-switcher-menu { width: 280px; right: -40px; }
    .biz-switcher-menu::before { right: 60px; }
}