:root {
    --bg: #0a0a0f;
    --bg-card: #0f0f1a;
    --bg-card-hover: #16162a;
    --bg-input: #111118;
    --border: #1a1a2e;
    --border-hover: #2e2e4a;
    --text: #e8e8f0;
    --text-muted: #6b6b8a;
    --text-dim: #3a3a52;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99,102,241,0.2);
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --sidebar-width: 220px;
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ===== SIDEBAR LAYOUT ===== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #0d0d14;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 20px 20px 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    flex-shrink: 0;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: #111118;
    color: var(--text);
}

.nav-item.active {
    background: #6366f118;
    color: var(--accent);
}

.nav-item svg {
    flex-shrink: 0;
}

button.nav-item {
    width: 100%;
    background: transparent;
    border: none;
    font-family: inherit;
    text-align: left;
}

.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-role {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-logout {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
    cursor: pointer;
}

.sidebar-logout:hover {
    color: var(--text);
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 28px 32px;
    min-height: 100vh;
    flex: 1;
}

/* ===== PAGE HERO ===== */

.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.hero-status {
    display: flex;
    align-items: center;
    padding-top: 4px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 99px;
}

.status-pill.online {
    background: #22c55e18;
    color: var(--green);
    border: 1px solid #22c55e30;
}

/* ===== STATS ROW ===== */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 0 0 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s;
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== DASHBOARD GRID ===== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.col-main { min-width: 0; }
.col-side { min-width: 0; }

/* ===== WIDGET ===== */

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

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

.widget-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.widget-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--border);
    padding: 2px 10px;
    border-radius: 99px;
    border: 1px solid transparent;
}

.widget-action {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

.widget-action:hover {
    color: var(--accent-hover);
}

/* ===== SERVICES GRID ===== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.svc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #13131e;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    color: inherit;
}

.svc-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.svc-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.svc-card-info {
    flex: 1;
    min-width: 0;
}

.svc-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.svc-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.svc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
}

.svc-status-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34,197,94,0.4);
}

.svc-status-dot.offline {
    background: var(--red);
}

.svc-status-dot.loading {
    background: var(--text-dim);
}

/* ===== TASKS ===== */

.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.task-row:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--text-dim);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-checkbox.done {
    background: #22c55e30;
    border-color: var(--green);
    color: var(--green);
}

.task-title {
    font-size: 13px;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta {
    font-size: 10px;
    color: var(--text-dim);
    white-space: nowrap;
}

.skeleton-task {
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(90deg, #111118, #1a1a2e, #111118);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== QUICK LINKS (sidebar col) ===== */

.quick-links-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #13131e;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-link-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== SYSTEM INFO ===== */

.sys-info { }

.sys-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.sys-row:last-child {
    border-bottom: none;
}

.sys-row span:first-child {
    color: var(--text-muted);
}

.sys-row span:last-child {
    color: var(--text);
}

/* ===== INFRA PAGE ===== */

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.user-item:last-child {
    border-bottom: none;
}

.action-btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.action-btn.approve {
    background: #22c55e18;
    color: var(--green);
    border: 1px solid #22c55e30;
}

.action-btn.approve:hover {
    background: #22c55e30;
}

.action-btn.deny {
    background: #ef444418;
    color: var(--red);
    border: 1px solid #ef444430;
}

.action-btn.deny:hover {
    background: #ef444430;
}

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== FORM ELEMENTS ===== */

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

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 9px 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group textarea { resize: vertical; min-height: 80px; }

.form-message {
    margin-top: 10px;
    font-size: 13px;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
}

.form-message.success {
    background: rgba(34,197,94,0.08);
    color: var(--green);
    border: 1px solid rgba(34,197,94,0.2);
}

.form-message.error {
    background: rgba(239,68,68,0.08);
    color: var(--red);
    border: 1px solid rgba(239,68,68,0.2);
}

/* ===== LANDING (no sidebar) ===== */

.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 60px 24px;
    position: relative;
}

.landing::before {
    content: '';
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(ellipse at center, rgba(99,102,241,0.07) 0%, transparent 65%);
    pointer-events: none;
}

.landing-logo {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 12px;
    color: var(--text);
}

.landing-logo .accent { color: var(--accent); }

.landing-sub {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 48px;
    max-width: 360px;
    line-height: 1.6;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 600px;
    width: 100%;
    margin-bottom: 44px;
}

.landing-feature {
    padding: 18px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
    transition: border-color 0.15s;
}

.landing-feature:hover { border-color: var(--border-hover); }

.landing-feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: var(--accent-glow);
    color: var(--accent-hover);
}

.landing-feature h3 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.landing-feature p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 28px;
    background: #ffffff;
    color: #1f1f1f;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: none;
    text-decoration: none;
}

.google-btn:hover {
    color: #1f1f1f;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    transform: translateY(-1px);
}

.google-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.landing-footer {
    position: absolute;
    bottom: 28px;
    font-size: 12px;
    color: var(--text-dim);
}

/* ===== PENDING PAGE ===== */

.pending-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px 24px;
}

.pending-logo { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 32px; }
.pending-logo .accent { color: var(--accent); }

.pending-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--red);
}

.pending-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 8px; }
.pending-sub { font-size: 14px; color: var(--text-muted); max-width: 340px; line-height: 1.6; margin-bottom: 4px; }
.pending-email { font-size: 13px; color: var(--text-dim); margin-bottom: 28px; }

/* ===== STATUS BADGES ===== */

.status-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 600;
}

.status-badge.pending { background: rgba(245,158,11,0.1); color: var(--yellow); border: 1px solid rgba(245,158,11,0.2); }
.status-badge.approved { background: rgba(34,197,94,0.1); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.status-badge.denied { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

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

.requests-table { width: 100%; border-collapse: collapse; }
.requests-table th {
    text-align: left; font-size: 11px; color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.requests-table td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.requests-table tr:last-child td { border-bottom: none; }

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }
    .landing-logo { font-size: 2.5rem; }
    .landing-grid { grid-template-columns: 1fr; max-width: 300px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .page-hero { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .landing-logo { font-size: 2rem; }
}

/* ===== SKILLS MODAL ===== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay[hidden] { display: none; }

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
    width: 100%;
    max-width: 740px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.65);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.modal-search {
    flex: 1;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.modal-search:focus { border-color: var(--accent); }
.modal-search::placeholder { color: var(--text-dim); }

.modal-close {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    font-size: 14px;
    line-height: 1;
    font-family: inherit;
}

.modal-close:hover { border-color: var(--border-hover); color: var(--text); }

.modal-body {
    overflow-y: auto;
    padding: 4px 18px 16px;
    flex: 1;
}

.skills-section {
    border-bottom: 1px solid var(--border);
}

.skills-section:last-child { border-bottom: none; }

.skills-section > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 2px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.skills-section > summary::-webkit-details-marker { display: none; }

.skills-section > summary::before {
    content: '▸';
    font-size: 9px;
    color: var(--text-dim);
    transition: transform 0.15s;
    display: inline-block;
    width: 10px;
}

.skills-section[open] > summary::before { transform: rotate(90deg); }

.skills-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 6px;
}

.skills-table th {
    text-align: left;
    font-size: 9px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px 5px;
}

.skills-table td {
    padding: 6px 8px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.5;
}

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

.skills-table td:first-child {
    color: var(--accent-hover);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: nowrap;
    width: 180px;
    font-weight: 600;
}

.skills-table td:last-child { color: var(--text-muted); }

.skills-table tr.sk-hidden { display: none; }

.skills-section.sk-hidden { display: none; }

.skills-rules {
    padding: 6px 8px 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

.skills-rules strong { color: var(--accent-hover); font-weight: 600; }

.skills-where {
    padding: 6px 8px 10px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

.skills-where strong { color: var(--text); font-weight: 600; }
