/* SiteLift CMS — Design System */

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --accent: #06b6d4;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-dark: #0f172a;
    --border: #e2e8f0;
    --border-focus: #4f46e5;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg-subtle);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== NAV ===== */
.nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
    text-decoration: none;
}
.nav-brand-sub {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 4px;
}
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-link {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text); }
.nav-link.active { background: var(--primary); color: white; }
.nav-link-muted { color: var(--text-muted); }

/* ===== LAYOUT ===== */
.main { padding: 2rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header-actions { display: flex; gap: 0.5rem; }

/* ===== CARDS ===== */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.card-description { color: var(--text-muted); font-size: 0.875rem; margin: -0.5rem 0 1rem; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.card-header .card-title { margin-bottom: 0; }
.card-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.stat-card-accent { border-left: 3px solid var(--primary); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--text); }
.stat-number-sm { font-size: 1.25rem; font-weight: 600; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.stat-sub { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.25rem; }
.stat-link { font-size: 0.85rem; color: var(--primary); word-break: break-all; }

/* ===== DETAIL GRID ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 500; }

/* ===== TABLES ===== */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table a { color: var(--primary); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-maintenance { background: #f1f5f9; color: #475569; }
.badge-starter { background: #dbeafe; color: #1d4ed8; }
.badge-growth { background: #d1fae5; color: #065f46; }
.badge-pro { background: #ede9fe; color: #5b21b6; }
.badge-scale { background: #fef3c7; color: #92400e; }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-inactive { background: var(--danger-light); color: var(--danger); }

/* ===== FEATURE LIST ===== */
.feature-list { list-style: none; padding: 0; }
.feature-list li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.feature-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-group textarea { resize: vertical; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; display: block; }
.form-section-title { font-size: 0.9rem; font-weight: 600; margin: 1.5rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.form-section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.filter-bar { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.filter-search {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
}
.filter-search:focus { outline: none; border-color: var(--border-focus); }
.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--text-muted); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.7rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== REPEATABLE ITEMS ===== */
.repeatable-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    position: relative;
}
.repeatable-item .form-row { align-items: end; }
.btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    align-self: end;
    margin-bottom: 1rem;
}
.btn-remove:hover { background: var(--danger-light); }

/* ===== EDITOR ACTIONS ===== */
.editor-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.editor-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ===== AUTH ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 100%);
}
.auth-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-brand { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.auth-form .form-group { margin-bottom: 1.25rem; }

/* ===== FLASH MESSAGES ===== */
.flash-container { max-width: 1200px; margin: 0 auto 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.flash-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.flash-info { background: var(--info-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.link-external { color: var(--primary); text-decoration: none; font-size: 0.85rem; }
.link-external:hover { text-decoration: underline; }
.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { gap: 0.125rem; }
    .nav-link { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .editor-actions { flex-direction: column; align-items: stretch; text-align: center; }
}
