/* ??? Design Tokens ??????????????????????????????????????????? */
:root {
    --primary:        #4f46e5;
    --primary-dark:   #3730a3;
    --primary-light:  #818cf8;
    --primary-bg:     #eef2ff;
    --accent:         #06b6d4;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --sidebar-w:      260px;
    --sidebar-bg:     #1e1b4b;
    --sidebar-text:   #c7d2fe;
    --sidebar-hover:  rgba(255,255,255,0.08);
    --sidebar-active: rgba(255,255,255,0.14);
    --topbar-h:       64px;
    --topbar-bg:      #ffffff;
    --body-bg:        #f1f5f9;
    --card-bg:        #ffffff;
    --text-primary:   #0f172a;
    --text-secondary: #64748b;
    --border:         #e2e8f0;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:      0 4px 6px -1px rgba(0,0,0,.1),  0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
    --radius:         .75rem;
    --radius-sm:      .5rem;
    --transition:     .2s ease;
}

/* ??? Reset / Base ????????????????????????????????????????????? */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--body-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ??? Scrollbar ????????????????????????????????????????????????? */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ??? Admin Shell ??????????????????????????????????????????????? */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

/* ??? Sidebar ??????????????????????????????????????????????????? */
.admin-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform var(--transition);
    overflow: hidden;
}

.admin-sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-w)));
}

/* brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.5rem;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(255,255,255,.07);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
    line-height: 1.2;
}

.sidebar-brand-text small {
    display: block;
    font-size: .7rem;
    font-weight: 400;
    color: var(--sidebar-text);
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* nav body */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6366f1;
    padding: 1rem 1.5rem .4rem;
}

.sidebar-item {
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    color: var(--sidebar-text);
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    text-decoration: none;
    position: relative;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 4px 4px 0;
}

.sidebar-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    opacity: .8;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon { opacity: 1; }

.sidebar-badge {
    margin-left: auto;
    font-size: .65rem;
    padding: .15rem .45rem;
    border-radius: 99px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* sidebar footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-footer-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-footer-info {
    flex: 1;
    min-width: 0;
}

.sidebar-footer-name {
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-role {
    font-size: .7rem;
    color: var(--sidebar-text);
}

/* ??? Main Area ???????????????????????????????????????????????? */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.admin-main.expanded { margin-left: 0; }

/* ??? Top Bar ?????????????????????????????????????????????????? */
.admin-topbar {
    height: var(--topbar-h);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.topbar-toggle:hover { background: var(--primary-bg); color: var(--primary); }

.topbar-search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 1rem 0 2.5rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--body-bg);
    font-size: .85rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.topbar-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
    background: #fff;
}

.topbar-search input::placeholder { color: var(--text-secondary); }

.topbar-search-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

/* icon buttons in topbar */
.topbar-btn {
    position: relative;
    width: 38px; height: 38px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.topbar-btn:hover { background: var(--primary-bg); color: var(--primary); }

.topbar-btn-badge {
    position: absolute;
    top: 5px; right: 5px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--topbar-bg);
}

/* language selector */
.topbar-lang {
    display: flex;
    align-items: center;
    gap: .4rem;
    height: 38px;
    padding: 0 .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: border-color var(--transition), background var(--transition);
    position: relative;
}

.topbar-lang:hover { border-color: var(--primary); background: var(--primary-bg); }

.topbar-lang-flag { font-size: 1rem; }

/* topbar divider */
.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}

/* user dropdown */
.topbar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .3rem .6rem .3rem .3rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    background: transparent;
    position: relative;
}

.topbar-user:hover { background: var(--primary-bg); }

.topbar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-info { text-align: left; }

.topbar-user-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.topbar-user-role {
    font-size: .7rem;
    color: var(--text-secondary);
}

/* dropdown panel */
.topbar-dropdown {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    overflow: hidden;
    animation: fadeSlideDown .15s ease;
}

.topbar-dropdown-header {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--primary-bg);
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 1rem;
    color: var(--text-primary);
    font-size: .83rem;
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    text-decoration: none;
}

.topbar-dropdown-item:hover { background: var(--primary-bg); color: var(--primary); }
.topbar-dropdown-item.danger:hover { background: #fef2f2; color: var(--danger); }

.topbar-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: .25rem 0;
}

/* notification panel */
.notif-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    width: 340px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    animation: fadeSlideDown .15s ease;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notif-panel-title { font-weight: 700; font-size: .9rem; }

.notif-item {
    display: flex;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    cursor: pointer;
}

.notif-item:hover { background: var(--body-bg); }
.notif-item.unread { background: var(--primary-bg); }

.notif-icon-wrap {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
}

.notif-text { flex: 1; }
.notif-title { font-size: .82rem; font-weight: 600; }
.notif-desc  { font-size: .76rem; color: var(--text-secondary); margin-top: .1rem; }
.notif-time  { font-size: .7rem;  color: var(--text-secondary); margin-top: .2rem; }

.notif-panel-footer {
    padding: .65rem 1rem;
    text-align: center;
    font-size: .8rem;
    color: var(--primary);
    cursor: pointer;
    transition: background var(--transition);
}

.notif-panel-footer:hover { background: var(--primary-bg); }

/* lang panel */
.lang-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    overflow: hidden;
    animation: fadeSlideDown .15s ease;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .83rem;
    transition: background var(--transition);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.lang-item:hover { background: var(--primary-bg); }
.lang-item.selected { background: var(--primary-bg); color: var(--primary); font-weight: 600; }

/* ??? Page Content ????????????????????????????????????????????? */
.admin-content {
    flex: 1;
    padding: 1.75rem;
    overflow-y: auto;
}

/* breadcrumb */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .25rem;
}

.page-breadcrumb {
    font-size: .78rem;
    color: var(--text-secondary);
}

.page-breadcrumb a { color: var(--text-secondary); }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb .separator { margin: 0 .4rem; }

/* ??? Cards ???????????????????????????????????????????????????? */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-weight: 700;
    font-size: .95rem;
    margin: 0;
}

.card-body { padding: 1.25rem; }

/* stat card */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-card-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-card-icon.purple { background: var(--primary-bg); color: var(--primary); }
.stat-card-icon.green  { background: #d1fae5; color: var(--success); }
.stat-card-icon.amber  { background: #fef3c7; color: var(--warning); }
.stat-card-icon.cyan   { background: #cffafe; color: var(--accent); }
.stat-card-icon.red    { background: #fee2e2; color: var(--danger); }

.stat-card-body { flex: 1; min-width: 0; }

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: .15rem;
}

.stat-card-change {
    font-size: .75rem;
    font-weight: 600;
    margin-top: .3rem;
}

.stat-card-change.up   { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ??? Table ???????????????????????????????????????????????????? */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--body-bg);
    white-space: nowrap;
}

.data-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .84rem;
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: #fafbfc; }

/* ??? Badges ??????????????????????????????????????????????????? */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .65rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
}

.badge-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-status.pending    { background: #fef3c7; color: #92400e; }
.badge-status.confirmed  { background: #d1fae5; color: #065f46; }
.badge-status.cancelled  { background: #fee2e2; color: #991b1b; }
.badge-status.completed  { background: #dbeafe; color: #1e40af; }
.badge-status.checkedin  { background: #cffafe; color: #155e75; }

/* ??? Buttons ?????????????????????????????????????????????????? */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
    font-size: .84rem;
    border-radius: var(--radius-sm);
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.2);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-size: .84rem;
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ??? Form controls ???????????????????????????????????????????? */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    font-size: .85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .35rem; }

/* ??? Animations ??????????????????????????????????????????????? */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ??? Validation ??????????????????????????????????????????????? */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: .78rem; }

/* ??? Blazor error UI ?????????????????????????????????????????? */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 1rem; left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .84rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
}

#blazor-error-ui a { color: #fff; text-decoration: underline; }

/* ??? Responsive ??????????????????????????????????????????????? */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .topbar-search { max-width: 160px; }
    .topbar-user-info { display: none; }
}

/* ???????????????????????????????????????????????????????????????
   MOBILE APP SHELL  (MobileLayout / MobilePublicLayout – MAUI)
   ??????????????????????????????????????????????????????????????? */

/* ?? CSS safe-area support for notched / home-indicator devices ?? */
:root {
    --mobile-topbar-h:    60px;
    --mobile-bottomnav-h: 64px;
    --safe-top:    0px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Status bar spacer – MAUI handles the top safe area natively via ContentPage
   padding, so this div needs no height on Android/iOS MAUI builds.
   It is kept for structural consistency only. */
.status-bar-safe-area {
    display: none;
}

/* ?? Shell ?? */
.mobile-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--body-bg);
    overflow-x: hidden;
}

/* ?? Top Bar ?? */
.mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--mobile-topbar-h);
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    padding-left: 1rem;
    padding-right: 1rem;
    gap: .75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.mobile-topbar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 44px;
}

.mobile-topbar-center {
    flex: 1;
    text-align: center;
    overflow: hidden;
}

.mobile-topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    min-width: 44px;
    justify-content: flex-end;
    position: relative;
}

/* Avatar chip */
.mobile-topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Icon button */
.mobile-topbar-btn {
    position: relative;
    background: rgba(255,255,255,.1);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.9);
    cursor: pointer;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-topbar-btn:active { background: rgba(255,255,255,.2); }

/* Badge */
.mobile-topbar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--sidebar-bg);
}

/* Sign-in link */
.mobile-topbar-signin {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary-light);
    text-decoration: none;
    padding: .3rem .6rem;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    white-space: nowrap;
}

/* Quick sign-out menu */
.mobile-user-quick {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1200;
    min-width: 120px;
    overflow: hidden;
}

.mobile-user-quick-item {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    background: none;
    border: none;
    font-size: .85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.mobile-user-quick-item.danger { color: var(--danger); }
.mobile-user-quick-item.danger:active { background: #fef2f2; }

/* ?? Page Content ?? */
.mobile-content {
    flex: 1;
    padding-top: var(--mobile-topbar-h);
    padding-bottom: calc(var(--mobile-bottomnav-h) + var(--safe-bottom));
    overflow-y: auto;
    overflow-x: hidden;
}

/* ?? Bottom Navigation Bar ?? */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: calc(var(--mobile-bottomnav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--sidebar-bg);
    display: flex;
    align-items: flex-start;
    padding-top: .5rem;
    border-top: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 -4px 16px rgba(0,0,0,.3);
    /* notch cutout behind the AI button */
    overflow: visible;
}

/* Each regular nav item (NavLink or button) */
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .25rem .25rem 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    min-width: 0;
    position: relative;
}

.mobile-nav-item:active,
.mobile-nav-item.active {
    color: var(--primary-light);
}

.mobile-nav-item.active .mobile-nav-icon {
    filter: drop-shadow(0 0 4px rgba(129,140,248,.7));
}

.mobile-nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: stroke .15s;
}

/* Active-tab top pip */
.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    width: 28px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 0 0 4px 4px;
}

/* ?? AI Planner centre floating button ?? */
.mobile-nav-ai-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .3rem;
    position: relative;
    /* push the circle above the bar */
    padding-top: 0;
    min-width: 0;
}

.mobile-nav-ai-btn {
    position: absolute;
    /* sit 50% above the top edge of the nav bar */
    top: calc(-1 * (56px / 2) - 8px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(79,70,229,.55), 0 0 0 4px var(--sidebar-bg);
    transition: transform .2s ease, box-shadow .2s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    /* active ring when on /tour-planner */
}

.mobile-nav-ai-btn:active {
    transform: scale(.93);
}

.mobile-nav-ai-btn.active {
    box-shadow: 0 4px 24px rgba(124,58,237,.75), 0 0 0 4px var(--sidebar-bg), 0 0 0 7px rgba(129,140,248,.35);
}

.mobile-nav-ai-btn svg {
    stroke: #fff;
}

/* The label below the circle, sits inside the bar */
.mobile-nav-ai-label {
    margin-top: 38px; /* clear the circle */
    font-size: .65rem;
    font-weight: 600;
    color: var(--sidebar-text);
    letter-spacing: .02em;
    text-align: center;
    line-height: 1;
}

/* ???????????????????????????????????????????????????????????????
   LOGIN / REGISTER / AUTH PAGES
   ??????????????????????????????????????????????????????????????? */

/* ?? Page shell: two-column split ?? */
.login-page {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--body-bg);
}

/* ?? Left: decorative brand panel ?? */
.login-brand {
    flex: 0 0 44%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--sidebar-bg) 0%, #312e81 55%, #4c1d95 100%);
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99,102,241,.25) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(6,182,212,.15)  0%, transparent 60%);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
    width: 100%;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 2.5rem;
}

.login-logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.login-logo-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.login-logo-tagline {
    font-size: .72rem;
    font-weight: 500;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-top: .1rem;
}

.login-headline {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
}

.login-headline span {
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-sub {
    font-size: .9rem;
    color: rgba(255,255,255,.65);
    line-height: 1.65;
    margin-bottom: 2rem;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255,255,255,.8);
    font-size: .87rem;
    font-weight: 500;
}

.login-feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ?? Right: form panel ?? */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

/* ?? Card ?? */
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.login-card-header {
    margin-bottom: 1.5rem;
}

.login-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: .3rem;
    letter-spacing: -.01em;
}

.login-card-subtitle {
    font-size: .85rem;
    color: var(--text-secondary);
}

/* ?? Error alert ?? */
.login-error {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: .84rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

/* ?? Form field ?? */
.login-field {
    margin-bottom: 1.1rem;
}

.login-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: .9rem;
    color: var(--text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.login-input {
    width: 100%;
    height: 44px;
    padding: 0 2.8rem 0 2.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--text-primary);
    background: var(--card-bg);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.login-input::placeholder { color: #94a3b8; }

.login-input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.login-eye {
    position: absolute;
    right: .75rem;
    background: none;
    border: none;
    padding: .25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color var(--transition);
}

.login-eye:hover { color: var(--primary); }

/* ?? Validation message ?? */
.login-validation {
    display: block;
    font-size: .75rem;
    color: var(--danger);
    margin-top: .35rem;
}

/* ?? Submit button ?? */
.login-btn {
    width: 100%;
    height: 46px;
    margin-top: 1.5rem;
    background: var(--primary);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    letter-spacing: .01em;
}

.login-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(79,70,229,.4);
    transform: translateY(-1px);
}

.login-btn:active:not(:disabled) { transform: translateY(0); }

.login-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

/* ?? Loading spinner ?? */
.login-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* ?? Card footer ?? */
.login-card-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ?? Auth shell (used by AuthLayout on web) ?? */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--body-bg);
}

/* ?? Mobile overrides: hide brand panel, single-column card ?? */
@media (max-width: 767px) {
    .login-page {
        flex-direction: column;
        min-height: unset;
        background: var(--body-bg);
    }

    .login-brand {
        display: none;
    }

    .login-form-panel {
        flex: none;
        width: 100%;
        padding: 1.5rem 1rem 2rem;
        align-items: flex-start;
    }

    .login-card {
        max-width: 100%;
        box-shadow: var(--shadow-sm);
        padding: 1.5rem;
    }
}

/* Inside the MAUI mobile shell .mobile-content, always single-column */
.mobile-content .login-brand { display: none; }
.mobile-content .login-page  { flex-direction: column; min-height: unset; }
.mobile-content .login-form-panel { flex: none; width: 100%; padding: 1.25rem 1rem 2rem; align-items: flex-start; }
.mobile-content .login-card { max-width: 100%; box-shadow: var(--shadow-sm); padding: 1.5rem; }
