/* assets/css/app.css */

:root {
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 60px;
    --topnav-height: 56px;
    --sidebar-bg: #1a1f2e;
    --sidebar-text: #8892a4;
    --sidebar-active-bg: rgba(255,255,255,0.08);
    --sidebar-active-text: #ffffff;
    --sidebar-hover-bg: rgba(255,255,255,0.05);
    --brand-color: #4f8ef7;
    --topnav-bg: #ffffff;
    --topnav-border: #e9ecef;
    --page-bg: #f4f6f9;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-size: 0.9rem;
    background: var(--page-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── App layout ───────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: width 0.2s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--topnav-height);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-brand i {
    font-size: 1.2rem;
    color: var(--brand-color);
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-left-color: var(--brand-color);
}

.sidebar-link i {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-link.text-danger-soft {
    color: #e07070;
}
.sidebar-link.text-danger-soft:hover {
    color: #ff8080;
    background: rgba(255,100,100,0.06);
}

.sidebar-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 8px 0;
}

/* Hide labels when collapsed */
.sidebar.collapsed .sidebar-label {
    display: none;
}

/* ── Main content ─────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* ── Topnav ───────────────────────────────────────────────── */
.topnav {
    height: var(--topnav-height);
    background: var(--topnav-bg);
    border-bottom: 1px solid var(--topnav-border);
    position: sticky;
    top: 0;
    z-index: 99;
}

.topnav-page-title {
    font-size: 0.925rem;
    color: #343a40;
}

.topnav-user {
    background: none;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 5px 10px;
    color: #343a40;
}

.topnav-user:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Page body ────────────────────────────────────────────── */
.page-body {
    padding: 1.5rem;
    flex: 1;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    border-radius: 10px;
}

/* ── Auth / Setup pages ───────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3450 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.auth-logo { max-height: 60px; width: auto; }

/* ── Setup wizard ─────────────────────────────────────────── */
.setup-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3450 100%);
    padding: 2rem 0;
}

.setup-card {
    width: 100%;
    max-width: 620px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.step-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: #dee2e6;
    color: #6c757d;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.step-bubble.active  { background: #0d6efd; color: #fff; }
.step-bubble.completed { background: #198754; color: #fff; }

.step-line {
    flex: 1;
    height: 3px;
    background: #dee2e6;
    max-width: 80px;
    transition: background 0.2s;
}

.step-line.completed { background: #198754; }

/* ── Toast container ──────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
}

/* ── Utility ──────────────────────────────────────────────── */
.font-monospace { font-family: 'Courier New', monospace; }

.bg-success-subtle { background-color: #d1e7dd !important; }
.bg-secondary-subtle { background-color: #e2e3e5 !important; }
.bg-warning-subtle { background-color: #fff3cd !important; }
.bg-primary-subtle { background-color: #cfe2ff !important; }
.bg-light { background-color: #f8f9fa !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    .sidebar .sidebar-label {
        display: none;
    }
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
    }
}

/* ── Stat icons ───────────────────────────────────────────── */
.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}