/* ==========================================================
   ZENAUTH PROPRIETARY AESTHETIC: OBSIDIAN & GOLD GLASS
   ========================================================== */

:root {
    /* Color Palette */
    --gold-primary: #FFD700;
    --gold-gradient: linear-gradient(135deg, #FFD700 0%, #F9A826 100%);
    --bg-deep: #050507;
    --glass-bg: rgba(20, 21, 26, 0.45);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    
    /* Text */
    --text-pure: #ffffff;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    
    /* Status Buttons */
    --btn-blue: rgba(59, 130, 246, 0.2);
    --btn-blue-border: rgba(59, 130, 246, 0.5);
    --btn-blue-text: #60a5fa;

    --btn-green: rgba(34, 197, 94, 0.2);
    --btn-green-border: rgba(34, 197, 94, 0.5);
    --btn-green-text: #4ade80;

    --btn-red: rgba(239, 68, 68, 0.2);
    --btn-red-border: rgba(239, 68, 68, 0.5);
    --btn-red-text: #f87171;

    --btn-purple: rgba(168, 85, 247, 0.2);
    --btn-purple-border: rgba(168, 85, 247, 0.5);
    --btn-purple-text: #c084fc;

    --btn-yellow: rgba(255, 215, 0, 0.15);
    --btn-yellow-border: rgba(255, 215, 0, 0.4);
    --btn-yellow-text: #FFD700;
}

/* Global Reset */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body.zenauth-obsidian {
    background: radial-gradient(circle at top left, #1a1a24 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow: hidden; /* Lock scroll to main content area */
}

/* ---------------------------------------------------
   CAPSULE LAYOUT GRID 
   --------------------------------------------------- */
.dashboard-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    padding: 1.5rem; /* The gap creating the "floating" illusion */
    gap: 1.5rem;
}

/* ---------------------------------------------------
   FLOATING SIDEBAR CAPSULE 
   --------------------------------------------------- */
.sidebar {
    width: 280px;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glow-shadow);
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
}

.sidebar-header .brand {
    font-size: 2rem;
    font-weight: 800;
    color: transparent;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    text-transform: tracking;
    letter-spacing: -1px;
    text-decoration: none;
}

.app-selector-wrapper {
    padding: 1rem 1.5rem;
}

.app-selector {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,215,0,0.15);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.app-selector:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(255,215,0,0.1);
}

.app-dropdown {
    position: absolute; top: calc(100% - 1rem); left: 1.5rem; right: 1.5rem;
    background: var(--bg-deep); border: 1px solid var(--glass-border);
    border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    display: none; flex-direction: column; z-index: 50; overflow: hidden;
    animation: fadeInDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-dropdown.active { display: flex; }
.app-dropdown-item {
    padding: 0.8rem 1rem; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: 0.2s;
}
.app-dropdown-item:hover { background: rgba(255,215,0,0.1); color: var(--gold-primary); }

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-pure);
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

/* Custom Scrollbar for Capsule */
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item a i {
    font-size: 1.25rem;
    transition: 0.2s;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-pure);
}

.nav-item a.active {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold-primary);
    border-left: 3px solid var(--gold-primary);
}

/* ---------------------------------------------------
   MAIN WORKSPACE CAPSULE 
   --------------------------------------------------- */
.main-content {
    flex: 1;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glow-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOP BAR INSIDE CAPSULE */
.top-header {
    height: 80px;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0,0,0,0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    width: 300px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-pure);
    font-size: 0.9rem;
    outline: none;
    width: 100%;
    font-family: inherit;
}

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

.avatar.bg-purple {
    width: 42px; height: 42px;
    background: var(--gold-gradient);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #000; font-size: 1.2rem;
}

.user-info .name { display: block; font-weight: 700; color: var(--text-pure); }
.user-info .sub { display: block; font-size: 0.75rem; color: var(--gold-primary); font-weight: 600; }

/* ---------------------------------------------------
   PAGE CONTAINER SCROLL AREA 
   --------------------------------------------------- */
.page-container {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
}

.page-container::-webkit-scrollbar { width: 6px; }
.page-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; }

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: 0.8rem;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    background: rgba(0,0,0,0.2);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    display: inline-flex;
}

.breadcrumb .ph-house { color: var(--gold-primary); font-size: 1.1rem; }
.accent-red { color: #f87171; }
.accent-red a { color: #f87171; text-decoration: underline; }
.text-green { color: #4ade80; }

/* Titles */
.page-title h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-pure);
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}
.page-title p { color: var(--text-muted); font-size: 1.05rem; }
.text-yellow { color: var(--gold-primary); text-decoration: none; font-weight: 600; }

/* ---------------------------------------------------
   UTILITIES & GRIDS 
   --------------------------------------------------- */
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.flex-column { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.w-100 { width: 100%; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.fw-600 { font-weight: 600; }
.cursor-pointer { cursor: pointer; }
.text-gray { color: var(--text-muted); }
.flex-1 { flex: 1; }

/* ---------------------------------------------------
   DASHBOARD STATS CARDS 
   --------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0.2) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.05);
}

.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.bg-purple-dark { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.bg-green-dark { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.bg-red-dark { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

.stat-info h3 { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-pure); }

/* ---------------------------------------------------
   GLASS CONTROLS & TABLE ACTIONS
   --------------------------------------------------- */
.controls-bar {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
}

.search-large input {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-pure);
    padding: 0.6rem 1rem; border-radius: 8px; font-size: 0.9rem; font-family: inherit; width: 350px;
    transition: 0.2s;
}
.search-large input:focus { border-color: var(--gold-primary); outline: none; }

.icon-btn {
    width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; cursor: pointer; transition: 0.2s; background: rgba(0,0,0,0.4); border: 1px solid;
}
.border-blue { border-color: var(--btn-blue-border); color: var(--btn-blue-text); }
.border-blue:hover { background: var(--btn-blue); }
.text-blue { color: var(--btn-blue-text); }

.border-yellow { border-color: var(--btn-yellow-border); color: var(--btn-yellow-text); }
.border-yellow:hover { background: var(--btn-yellow); }

.border-green { border-color: var(--btn-green-border); color: var(--btn-green-text); }
.border-green:hover { background: var(--btn-green); }
.text-green { color: var(--btn-green-text); }

.border-purple { border-color: var(--btn-purple-border); color: var(--btn-purple-text); }
.border-purple:hover { background: var(--btn-purple); }
.text-purple { color: var(--btn-purple-text); }

.border-red { border-color: var(--btn-red-border); color: var(--btn-red-text); }
.border-red:hover { background: var(--btn-red); }
.text-red { color: var(--btn-red-text); }

/* Custom Checkbox */
.custom-checkbox { position: relative; padding-left: 28px; cursor: pointer; user-select: none; }
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; }
.checkmark { position: absolute; top: 0; left: 0; height: 20px; width: 20px; background-color: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; transition: 0.2s; }
.custom-checkbox:hover input ~ .checkmark { border-color: var(--gold-primary); }
.custom-checkbox input:checked ~ .checkmark { background-color: var(--gold-primary); border-color: var(--gold-primary); }
.checkmark:after { content: ""; position: absolute; display: none; }
.custom-checkbox input:checked ~ .checkmark:after { display: block; }
.custom-checkbox .checkmark:after { left: 7px; top: 3px; width: 5px; height: 10px; border: solid #000; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.select-all { padding-left: 1rem; }

/* ---------------------------------------------------
   LICENSE / APP CARDS (RE-ENGINEERED)
   --------------------------------------------------- */
.licenses-grid { display: flex; flex-direction: column; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }

.license-card {
    background: linear-gradient(145deg, rgba(30,30,35,0.5) 0%, rgba(15,15,20,0.8) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.license-card:hover {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.05);
    transform: translateY(-2px);
}

.key-name { font-size: 1.05rem; font-family: monospace; font-weight: 700; letter-spacing: 0.5px; }

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    text-transform: uppercase;
}

.key-details {
    padding-top: 1rem;
    border-top: 1px dashed rgba(255,255,255,0.1);
}
.key-details .label { color: #64748b; margin-right: 0.4rem; }

/* Generic UI Box */
.notice-box {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 2rem;
    color: var(--text-main);
    font-size: 1.1rem;
}

/* Auth Cards Override */
.auth-card {
    background: rgba(20, 20, 25, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glow-shadow);
    padding: 3rem;
    width: 100%; max-width: 450px;
}
.auth-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff; border-radius: 12px; padding: 0.85rem 1rem; font-family: inherit; font-size: 0.95rem; width:100%; margin-bottom: 1rem;
    transition: 0.2s;
}
.auth-input:focus { border-color: var(--gold-primary); box-shadow: 0 0 10px rgba(255,215,0,0.1); outline:none; }
.btn-primary { 
    background: var(--gold-gradient); color: #000; border: none; border-radius: 12px; padding: 0.85rem; font-weight: 800; font-family: inherit; font-size: 1rem; cursor: pointer; transition: 0.2s; width: 100%;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(255,215,0,0.3); transform: scale(1.02); }

/* ---------------------------------------------------
   MANAGE APPS OVERRIDES (RESTORED)
   --------------------------------------------------- */
.stats-row { display: flex; gap: 1.5rem; margin-bottom: 2rem; }
.stats-row .stat-card { flex: 1; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem; }
.credentials-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 2rem;
    box-shadow: var(--glow-shadow);
}
.card-header-clean h3 { color: var(--gold-primary); margin-bottom: 0.5rem; font-size: 1.5rem; letter-spacing:-0.5px;}
.toggle-snippet { display: flex; align-items: center; gap: 1rem; color: var(--text-muted); font-weight: 600; font-size:0.85rem;}
.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: #fff; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--gold-primary); }
input:checked + .slider:before { transform: translateX(22px); background-color: var(--bg-deep); }

.cred-group { margin-bottom: 1.5rem; }
.cred-group label { display: block; font-size: 0.75rem; font-weight: 800; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 0.5rem; }
.cred-value { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); padding: 0.8rem 1.2rem; border-radius: 12px; font-family: monospace; font-size: 1rem; color: #fff; }
.cred-value i { color: var(--gold-primary); transition: 0.2s; font-size: 1.2rem; }
.cred-value i:hover { transform: scale(1.1); color: #fff; }
.blur-text span { filter: blur(6px); user-select: none; transition: 0.3s; }

.btn-orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); padding: 0.8rem 1.5rem; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-orange:hover { background: rgba(249, 115, 22, 0.25); }
.btn-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); padding: 0.8rem 1.5rem; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 0.5rem; }
.btn-blue:hover { background: rgba(59, 130, 246, 0.3); }

/* APP LIST CARDS */
.app-item-card {
    background: linear-gradient(145deg, rgba(30,30,35,0.4) 0%, rgba(15,15,20,0.6) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 1.5rem;
    transition: 0.3s;
}
.app-item-card.border-yellow { border-color: var(--gold-primary); box-shadow: 0 0 15px rgba(255,215,0,0.05); }
.app-item-card h4 { font-size: 1.2rem; font-weight: 800; color: #fff; letter-spacing: -0.5px;}

.badge { padding: 0.3rem 0.6rem; font-size: 0.7rem; font-weight: 800; border-radius: 8px; }
.badge-green { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.bg-orange { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }

.app-metadata { display: flex; justify-content: space-between; border-top: 1px dashed rgba(255,255,255,0.08); border-bottom: 1px dashed rgba(255,255,255,0.08); padding: 1rem 0; }
.meta-label { display: block; font-size: 0.7rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; margin-bottom: 0.3rem; }
.meta-value { font-size: 1.1rem; font-weight: 700; color: #fff; }

.app-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-action { padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; border: none; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; color: #fff; text-decoration: none; font-family: inherit;}
.bg-green-solid { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.4); color: #4ade80; }
.bg-purple-solid { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.4); color: #c084fc; }
.bg-teal-solid { background: rgba(20, 184, 166, 0.15); border: 1px solid rgba(20, 184, 166, 0.4); color: #2dd4bf; }
.bg-orange-solid { background: rgba(249, 115, 22, 0.15); border: 1px solid rgba(249, 115, 22, 0.4); color: #fb923c; }
.bg-red-solid { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #f87171; }

/* ---------------------------------------------------
   ZENAUTH INSTANT TOOLTIPS
   --------------------------------------------------- */
[data-tooltip] { position: relative; }
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) scale(0.9);
    background: rgba(10, 10, 12, 0.95);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,215,0,0.25);
    z-index: 999;
}
[data-tooltip]:hover::before { opacity: 1; transform: translateX(-50%) scale(1); }

