/* ==========================================================================
   KHAN • SAAS COMMAND CENTER (hub.asatkhanov.uz)
   Design System: Minimal Luxury Dark (Matches asatkhanov.uz Portfolio)
   Monochrome, Clean Apple/Linear Aesthetics, Zero Visual Noise
   ========================================================================== */

:root {
    /* Palette strictly based on asatkhanov.uz dark-theme */
    --bg: #0a0a0a;
    --bg2: #111111;
    --card: #141414;
    --card-hover: #181818;

    --t1: #ededed;
    --t2: #888888;
    --t3: #555555;

    --border: #222222;
    --border-hover: #383838;
    --border-focus: #555555;

    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.08);
    --green-border: rgba(16, 185, 129, 0.2);

    --amber: #f59e0b;
    --amber-bg: rgba(245, 158, 11, 0.08);
    --amber-border: rgba(245, 158, 11, 0.2);

    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.08);
    --red-border: rgba(239, 68, 68, 0.2);

    --cyan: #38bdf8;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 50px;

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.8);

    --transition: all 0.25s ease;
}

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

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    background-color: var(--bg);
    color: var(--t1);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 300;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

h1, h2, h3, h4, strong, b {
    font-weight: 500;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--t3);
}

/* ==========================================================================
   NAVIGATION (MATCHES PORTFOLIO FLOATING / TOP BAR)
   ========================================================================== */

.hub-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 36px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hub-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--t1);
}

.hub-brand-logo {
    width: 38px;
    height: 38px;
    background: #161616;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t1);
    transition: var(--transition);
}

.hub-brand:hover .hub-brand-logo {
    border-color: var(--t2);
    color: #ffffff;
}

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

.hub-brand-title {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--t1);
}

.hub-brand-subtitle {
    font-size: 0.7rem;
    color: var(--t2);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hub-nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hub-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    color: var(--t2);
}

.hub-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #222222;
    color: var(--t1);
    font-weight: 500;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-hub-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--t2);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-hub-logout:hover {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.4);
    background: var(--red-bg);
}

/* Layout */
.hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px;
    width: 100%;
}

/* ==========================================================================
   BUTTONS (CLEAN CAPSULE PILLS MATCHING PORTFOLIO .btn1 & .btn2)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    flex: none !important;
    /* CRITICAL: Never stretch across flex headers */
    width: auto !important;
}

/* Primary Action (Solid White / Light) */
.btn-primary {
    background: var(--t1);
    color: var(--bg);
    border: 1px solid var(--t1);
}

.btn-primary:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

/* Secondary Action (Subtle Dark Outline Pill) */
.btn-secondary {
    background: transparent;
    color: var(--t2);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--t1);
    border-color: var(--border-hover);
    background: var(--bg2);
}

/* Extend / Record Payment Button (+30 days) */
.btn-extend {
    background: var(--t1);
    color: var(--bg);
    border: 1px solid var(--t1);
    font-weight: 400;
}

.btn-extend:hover {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

/* Kill Switch (Restrained Danger Pill) */
.btn-killswitch {
    background: transparent;
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.btn-killswitch:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: #f87171;
}

.btn-killswitch.active-mode {
    background: transparent;
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn-killswitch.active-mode:hover {
    background: var(--green-bg);
    border-color: var(--green);
}

/* ==========================================================================
   EXECUTIVE KPI CARDS (CLEAN MONOCHROME METRICS)
   ========================================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.kpi-title {
    font-size: 0.78rem;
    color: var(--t2);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: #181818;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t2);
    transition: var(--transition);
}

.kpi-icon-green {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #34d399 !important;
}

.kpi-icon-cyan {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    color: #38bdf8 !important;
}

.kpi-icon-purple {
    background: rgba(167, 139, 250, 0.1) !important;
    border-color: rgba(167, 139, 250, 0.25) !important;
    color: #a78bfa !important;
}

.kpi-icon-red {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #f87171 !important;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--t1);
    line-height: 1.2;
    white-space: nowrap;
}

.kpi-tag {
    font-size: 0.72rem;
    font-weight: 400;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kpi-tag.green {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.kpi-tag.cyan {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.kpi-tag.purple {
    background: rgba(167, 139, 250, 0.1);
    color: #c084fc;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.kpi-tag.red {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.kpi-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 400;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: #1a1a1a;
    border: 1px solid var(--border);
    color: var(--t2);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.kpi-subtext {
    font-size: 0.78rem;
    color: var(--t3);
}

/* ==========================================================================
   NICHE CATEGORY BAR & BADGES
   ========================================================================== */

.niche-category-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.niche-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--t2);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
}

.niche-cat-tab:hover {
    color: var(--t1);
    border-color: var(--border-hover);
    background: #181818;
}

.niche-cat-tab.active {
    background: var(--t1);
    color: var(--bg);
    border-color: var(--t1);
    font-weight: 500;
}

.niche-cat-count {
    font-size: 0.72rem;
    font-weight: 400;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.niche-cat-tab.active .niche-cat-count {
    background: rgba(0, 0, 0, 0.14);
}

.badge-niche {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 400;
    border: 1px solid var(--border);
    background: #181818;
    color: var(--t2);
}

.badge-niche-auto {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fca5a5;
}

.badge-niche-barbershop {
    background: rgba(197, 160, 89, 0.12);
    border-color: rgba(197, 160, 89, 0.3);
    color: #dfbe7e;
}

.badge-niche-beauty {
    background: rgba(244, 114, 182, 0.1);
    border-color: rgba(244, 114, 182, 0.28);
    color: #f9a8d4;
}

.badge-niche-medical {
    background: rgba(45, 212, 191, 0.1);
    border-color: rgba(45, 212, 191, 0.28);
    color: #5eead4;
}

/* ==========================================================================
   TOOLBAR: SEARCH & FILTER CHIPS
   ========================================================================== */

.hub-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
}

.hub-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.hub-search-box {
    position: relative;
    min-width: 260px;
    max-width: 360px;
    width: 100%;
}

.hub-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--t3);
    pointer-events: none;
    width: 15px;
    height: 15px;
}

.hub-search-input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--t1);
    font-size: 0.84rem;
    font-family: inherit;
    transition: var(--transition);
}

.hub-search-input:focus {
    outline: none;
    border-color: var(--border-hover);
    background: #181818;
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--t2);
    font-size: 0.78rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-chip:hover {
    color: var(--t1);
    border-color: var(--border-hover);
}

.filter-chip.active {
    background: var(--t1);
    color: var(--bg);
    border-color: var(--t1);
    font-weight: 500;
}

.filter-chip.chip-active::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.filter-chip.chip-warning::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

.filter-chip.chip-locked::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
}

/* ==========================================================================
   TENANT CARDS GRID
   ========================================================================== */

.tenant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tenant-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.tenant-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tenant-card.is-locked {
    border-color: rgba(239, 68, 68, 0.25);
    background: #121010;
}

.tenant-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.tenant-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tenant-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: #1a1a1a;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--t1);
    flex-shrink: 0;
}

.tenant-card-info h3 {
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.tenant-card-info a {
    color: var(--t1);
    text-decoration: none;
    transition: var(--transition);
}

.tenant-card-info a:hover {
    color: #ffffff;
}

.tenant-meta-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tenant-slug {
    font-size: 0.74rem;
    color: var(--t2);
    font-family: monospace;
    background: #1a1a1a;
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
}

.tenant-bot-link {
    font-size: 0.76rem;
    color: #38bdf8;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
}

.tenant-bot-link:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
}

/* Status Badges (Minimalist Colored Pills with Glowing Dot) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    background: #161616;
    border: 1px solid var(--border);
    color: var(--t1);
}

.badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.badge-active::before {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.badge-warning::before {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.badge-grace {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    color: #fb923c;
}

.badge-grace::before {
    background: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.badge-locked {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.badge-locked::before {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.badge-start {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}
.badge-start::before {
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.badge-pro {
    background: rgba(197, 160, 89, 0.15);
    border-color: rgba(197, 160, 89, 0.4);
    color: #dfbe7e;
}
.badge-pro::before {
    background: #c5a059;
    box-shadow: 0 0 8px rgba(197, 160, 89, 0.6);
}

.badge-enterprise {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #c084fc;
}
.badge-enterprise::before {
    background: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

/* Tier Switcher Controls */
.tier-control-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.tier-card {
    border: 1px solid var(--border);
    background: var(--bg3);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}
.tier-card:hover {
    border-color: rgba(197, 160, 89, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.tier-card.active {
    border-color: #c5a059;
    background: rgba(197, 160, 89, 0.08);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.15);
}
.tier-card.active .tier-radio-dot {
    border-color: #c5a059;
}
.tier-card.active .tier-radio-dot span {
    background: #c5a059;
}
.tier-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 900px) {
    .tier-cards-grid {
        grid-template-columns: 1fr;
    }
}
.tier-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.tier-card-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--t1);
    letter-spacing: -0.01em;
}
.tier-card-sub {
    font-size: 0.72rem;
    color: var(--t3);
    margin-top: 2px;
}
.tier-radio-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.tier-radio-dot span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
}
.tier-card-price {
    font-size: 1.25rem;
    font-weight: 500;
    color: #c5a059;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}
.tier-price-period {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--t3);
}
.tier-card-features {
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}
.tier-feature-item {
    font-size: 0.76rem;
    color: var(--t2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tier-card-badge-popular {
    position: absolute;
    top: -10px;
    right: 14px;
    background: linear-gradient(135deg, #c5a059, #dfbe7e);
    color: #0b0f19;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.4);
    text-transform: uppercase;
}

/* Subscription Health Strip */
.sub-health-container {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 12px 0 16px 0;
}

.sub-health-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.sub-health-days {
    font-weight: 400;
    color: var(--t1);
}

.sub-health-days.amber {
    color: var(--amber);
}

.sub-health-days.red {
    color: var(--red);
}

.sub-health-expiry {
    color: var(--t3);
    font-size: 0.74rem;
}

.sub-progress-bar {
    width: 100%;
    height: 4px;
    border-radius: var(--radius-pill);
    background: #222222;
    overflow: hidden;
}

.sub-progress-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sub-progress-fill.green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.sub-progress-fill.amber {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.sub-progress-fill.red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Metadata Grid */
.tenant-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.tenant-meta-item-label {
    font-size: 0.7rem;
    color: var(--t3);
    text-transform: uppercase;
    font-weight: 400;
}

.tenant-meta-item-val {
    color: var(--t1);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Direct Access Links Bar (Pass-Through Impersonation) */
.direct-access-label {
    font-size: 0.7rem;
    color: var(--t3);
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.direct-access-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

.btn-access {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 400;
    text-decoration: none;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--t2);
    transition: var(--transition);
}

.btn-access:hover {
    color: var(--t1);
    border-color: var(--border-hover);
    background: #1a1a1a;
}

.btn-access-client:hover {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.08);
}

.btn-access-admin:hover {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
}

.btn-access-barber:hover {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.08);
}

/* Tenant Card Action Row */
.tenant-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   TENANT HERO HEADER CARD (DETAILED VIEW)
   ========================================================================== */

.tenant-hero-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
}

.hero-content-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-main-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 320px;
}

.hero-avatar {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1f1f1f 0%, #121212 100%);
    border: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 500;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.hero-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-title {
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
}

.hero-meta-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: #181818;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--t2);
    text-decoration: none;
    transition: var(--transition);
}

.meta-chip span {
    color: var(--t1);
    font-weight: 400;
}

.meta-chip-tg {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.meta-chip-tg span {
    color: #38bdf8;
    font-weight: 400;
}

.meta-chip-tg:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: #38bdf8;
}

.meta-chip-phone:hover {
    border-color: var(--border-hover);
    color: var(--t1);
}

.meta-slug {
    font-family: monospace;
    font-size: 0.76rem;
    color: #a3a3a3;
}

/* Tariff & Subscription Health Box in Hero */
.hero-tariff-card {
    background: #161616;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-tariff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hero-tariff-label {
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--t3);
}

.sub-days-pill {
    font-size: 0.72rem;
    font-weight: 400;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.sub-days-pill.green {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sub-days-pill.amber {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sub-days-pill.red {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.hero-tariff-fee {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.2;
}

.hero-tariff-fee .fee-period {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--t2);
}

.hero-tariff-expiry {
    font-size: 0.78rem;
    color: var(--t2);
    margin-bottom: 4px;
}

.hero-tariff-expiry strong {
    color: var(--t1);
}

.hero-progress-bar {
    width: 100%;
    height: 4px;
    background: #222222;
    border-radius: var(--radius-pill);
    overflow: hidden;
}

/* The 3 Direct Impersonation Cards */
.giant-access-card {
    text-decoration: none;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    background: var(--card);
    border: 1px solid var(--border);
}

.giant-access-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.giant-access-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #181818;
    border: 1px solid #282828;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--t1);
    margin-bottom: 16px;
    transition: var(--transition);
}

.giant-badge {
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--t2);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    transition: var(--transition);
}

/* Card Accent Tints */
.giant-card-client .giant-access-icon {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
}

.giant-card-client .giant-badge {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.giant-card-client:hover {
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.08);
}

.giant-card-admin .giant-access-icon {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.giant-card-admin .giant-badge {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.giant-card-admin:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.08);
}

.giant-card-barber .giant-access-icon {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.giant-card-barber .giant-badge {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.giant-card-barber:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.08);
}

/* Tabs */
.tab-navigation-bar {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--t2);
    font-size: 0.88rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--t1);
}

.tab-btn.active {
    color: var(--t1);
    border-bottom-color: var(--t1);
}

.detail-tab-pane {
    display: none;
}

.detail-tab-pane.active {
    display: block;
}

/* ==========================================================================
   SECTION HEADER (CRITICAL FIX FOR SIZING)
   ========================================================================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--t1);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.hub-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.hub-table th {
    background: var(--bg2);
    padding: 14px 18px;
    color: var(--t3);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.hub-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--t1);
    vertical-align: middle;
}

.hub-table tr:last-child td {
    border-bottom: none;
}

.hub-table tr:hover td {
    background: #181818;
}

.table-date {
    font-size: 0.82rem;
    color: var(--t2);
    white-space: nowrap;
}

.table-amount {
    font-weight: 500;
    color: #34d399;
    white-space: nowrap;
}

.table-period {
    color: var(--t2);
    font-size: 0.82rem;
    white-space: nowrap;
}

.table-badge-method {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    font-size: 0.74rem;
    font-weight: 400;
}

.table-mono {
    font-family: monospace;
    font-size: 0.76rem;
    color: var(--t2);
}

.table-comment {
    font-size: 0.82rem;
    color: var(--t2);
    max-width: 180px;
}

.table-empty {
    text-align: center;
    color: var(--t3);
    padding: 36px !important;
}

/* ==========================================================================
   MODALS & FORMS
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-window {
    background: #121212;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 28px;
    box-shadow: var(--shadow-hover);
    transform: scale(0.97);
    transition: var(--transition);
}

.modal-overlay.active .modal-window {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--t1);
}

.btn-modal-close {
    background: transparent;
    border: none;
    color: var(--t3);
    cursor: pointer;
    font-size: 1.2rem;
}

.btn-modal-close:hover {
    color: var(--t1);
}

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

.form-label {
    display: block;
    font-size: 0.8rem;
    color: var(--t2);
    margin-bottom: 5px;
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--t1);
    font-family: inherit;
    font-size: 0.88rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--t2);
    background: #111111;
}

textarea.form-control {
    resize: vertical;
}

/* Toast */
.toast-box {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #161616;
    border: 1px solid var(--border-hover);
    color: var(--t1);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    font-size: 0.85rem;
}

.toast-box.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   TENANT DETAIL PAGE COMPONENTS (CLEAN SEMANTIC REPLACEMENT FOR INLINE STYLES)
   ========================================================================== */

.detail-header-bar {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.detail-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}


.giant-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.giant-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.giant-card-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--t1);
    margin-bottom: 6px;
}

.giant-card-desc {
    font-size: 0.84rem;
    color: var(--t2);
    line-height: 1.5;
    margin-bottom: 18px;
}

.giant-card-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--t1);
    font-size: 0.84rem;
    font-weight: 400;
}

.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

.billing-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--t1);
}

.table-date {
    color: var(--t2);
    font-size: 0.82rem;
}

.table-amount {
    color: var(--t1);
    font-weight: 500;
    font-size: 0.9rem;
}

.table-period {
    font-size: 0.8rem;
    color: var(--t2);
}

.table-badge-method {
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 400;
    background: var(--bg2);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.table-mono {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--t3);
}

.table-comment {
    color: var(--t2);
    font-size: 0.82rem;
}

.table-empty {
    text-align: center;
    padding: 36px;
    color: var(--t3);
}

.settings-card {
    max-width: 720px;
    padding: 28px;
}

.settings-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Super-Admin White-Label & Live Showcase Presets */
.niche-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.niche-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(197, 160, 89, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.niche-select-block {
    margin-bottom: 18px;
}

.niche-select-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.niche-select-row .form-control {
    flex: 1;
}

@media (max-width: 640px) {
    .niche-select-row {
        flex-direction: column;
    }
}

.niche-presets-section {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.niche-presets-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--t1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.niche-presets-desc {
    font-size: 0.76rem;
    color: var(--t3);
    margin: 6px 0 12px 0;
    line-height: 1.45;
}

.niche-presets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    .niche-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .niche-presets-grid {
        grid-template-columns: 1fr;
    }
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--t1);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover:not(:disabled) {
    border-color: rgba(197, 160, 89, 0.55);
    transform: translateY(-1px);
}

.preset-btn.active {
    border-color: #c5a059;
    background: rgba(197, 160, 89, 0.1);
}

.preset-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.preset-btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(197, 160, 89, 0.12);
    border: 1px solid rgba(197, 160, 89, 0.28);
    color: #c5a059;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preset-btn-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.preset-btn-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--t1);
}

.preset-btn-sub {
    font-size: 0.7rem;
    color: var(--t3);
}

.preset-status-banner {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg3);
    border: 1px solid var(--border);
}

.preset-status-banner.success {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.preset-status-banner.error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
}

.preset-status-banner.loading {
    color: var(--t2);
}

/* ==========================================================================
   LOGIN PAGE COMPONENTS
   ========================================================================== */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
    box-shadow: var(--shadow-hover);
    position: relative;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
}

.login-brand-logo {
    width: 52px;
    height: 52px;
    background: #161616;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    color: var(--t1);
}

.login-brand h1 {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--t1);
    letter-spacing: -0.02em;
}

.login-brand p {
    font-size: 0.85rem;
    color: var(--t2);
    margin-top: 4px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .hub-nav {
        padding: 14px 18px;
    }

    .hub-container {
        padding: 20px 14px;
    }

    .tenant-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hub-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .hub-search-box {
        max-width: 100%;
    }

    .settings-row-2 {
        grid-template-columns: 1fr;
    }

    .hero-content-row {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-tariff-card {
        width: 100%;
        min-width: 0;
    }
}