/* ============================================================
   LIVES Ads — Design System
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
    /* Primary */
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;

    /* Neutral */
    --surface: #ffffff;
    --surface-dim: #f8f9fa;
    --surface-container: #f1f3f4;
    --on-surface: #202124;
    --on-surface-variant: #5f6368;
    --outline: #dadce0;

    /* Accent */
    --accent-blue: #4285f4;
    --accent-green: #34a853;
    --accent-yellow: #fbbc04;
    --accent-red: #ea4335;
    --accent-purple: #a142f4;
    --accent-orange: #fa903e;

    /* Gradients */
    --gradient-1: linear-gradient(135deg, #4285f4 0%, #a142f4 50%, #ea4335 100%);
    --gradient-2: linear-gradient(135deg, #1a73e8 0%, #a142f4 100%);
    --gradient-text: linear-gradient(90deg, #4285f4, #a142f4, #ea4335);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-xl: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
    --shadow-2xl: 0 25px 50px rgba(0,0,0,0.12);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--on-surface);
    background: var(--surface-dim);
    line-height: 1.6;
    overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === BUTTONS === */
.btn-primary {
    padding: 14px 28px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 20px rgba(26,115,232,0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 14px 28px;
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid var(--outline);
    cursor: pointer;
    font-family: inherit;
}
.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-ghost {
    padding: 10px 20px;
    border-radius: var(--radius-full);
    background: none;
    border: 1px solid var(--outline);
    color: var(--on-surface-variant);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-ghost:hover { background: var(--surface-container); }

.btn-success {
    padding: 14px 28px;
    border-radius: var(--radius-full);
    background: var(--accent-green);
    color: white;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-success:hover { filter: brightness(0.9); }

/* === FORMS === */
.input-group { margin-bottom: 16px; text-align: left; }
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--on-surface-variant);
}
.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--surface);
    color: var(--on-surface);
}
.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

/* === STATUS BADGES === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}
.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status-badge.active { background: #e6f4ea; color: #137333; }
.status-badge.pending { background: #fef7e0; color: #b06000; }
.status-badge.approved { background: #e8f0fe; color: #1a73e8; }
.status-badge.completed { background: var(--primary-light); color: var(--primary); }
.status-badge.draft { background: var(--surface-container); color: var(--on-surface-variant); }
.status-badge.rejected { background: #fce8e6; color: #c5221f; }
.status-badge.payment-failed { background: #fce8e6; color: #c5221f; }
.status-badge.cancelled { background: var(--surface-container); color: var(--on-surface-variant); }

/* === CARDS === */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--outline);
}
.card-xl {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 1px solid var(--outline);
}

/* === STAT CARDS === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-label {
    font-size: 13px;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.stat-label .material-icons-round { font-size: 16px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.stat-change.up { background: #e6f4ea; color: #137333; }
.stat-change.down { background: #fce8e6; color: #c5221f; }

/* === PROGRESS BAR === */
.progress-bar {
    height: 8px;
    background: var(--surface-container);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar.large { height: 16px; border-radius: 8px; }
.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--gradient-2);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === INFO BOX === */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
    font-size: 13px;
    line-height: 1.6;
}
.info-box.info { background: var(--primary-light); color: var(--on-surface-variant); }
.info-box.info .material-icons-round { color: var(--primary); }
.info-box.success { background: #e6f4ea; color: #137333; }
.info-box.success .material-icons-round { color: var(--accent-green); }
.info-box.warning { background: #fef7e0; color: #b06000; }
.info-box.warning .material-icons-round { color: var(--accent-yellow); }
.info-box.error { background: #fce8e6; color: #c5221f; }
.info-box.error .material-icons-round { color: var(--accent-red); }
.info-box .material-icons-round { font-size: 20px; flex-shrink: 0; }

/* === APP LAYOUT === */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--outline);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    margin-bottom: 32px;
    text-decoration: none;
    color: var(--on-surface);
}
.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}
.sidebar-logo span { font-weight: 700; font-size: 18px; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-item:hover { background: var(--surface-container); color: var(--on-surface); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-item .material-icons-round { font-size: 20px; }
.sidebar-divider { height: 1px; background: var(--outline); margin: 16px 0; }
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--surface-dim);
}
.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; }
.sidebar-user-email { font-size: 11px; color: var(--on-surface-variant); }

/* Main content */
.main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
}
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.main-title { font-size: 28px; font-weight: 700; }
.main-subtitle { font-size: 14px; color: var(--on-surface-variant); margin-top: 4px; }

/* === CHART MOCK === */
.chart-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    border: 1px solid var(--outline);
    margin-bottom: 24px;
}
.chart-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 24px; }
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 160px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--outline);
}
.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: var(--gradient-2);
    min-height: 4px;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.chart-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--on-surface-variant);
    white-space: nowrap;
}

/* === ANIMATIONS === */
.slide-in {
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* === SPINNERS === */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
.btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* === CARD VISUAL (payment cards) === */
.card-visual {
    width: 60px; height: 40px;
    background: var(--gradient-2);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 11px; font-weight: 600;
}

/* === MOBILE NAV === */
.mobile-header {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; z-index: 60;
    background: var(--surface); border-bottom: 1px solid var(--outline);
    padding: 12px 16px;
    align-items: center; justify-content: space-between;
}
.mobile-header .logo-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
.mobile-header span { font-weight: 700; font-size: 16px; }
.mobile-menu-btn {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    border: none; background: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--on-surface);
}
.sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 45;
    background: rgba(0,0,0,0.4);
}
.sidebar-overlay.visible { display: block; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .mobile-header { display: flex; }
    .sidebar {
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding-top: 72px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .stats-row { grid-template-columns: 1fr; }
    .main { padding: 16px; padding-top: 72px; }
}
