/* =========================================================================
   PixelStix Admin — Global Stylesheet
   Design language: clean white surfaces, neutral grays, vibrant indigo
   reserved exclusively for actionable / attention-worthy elements.
   ========================================================================= */

/* ─── Design Tokens ─────────────────────────────────────────────── */

:root {
    /* Accents (vibrant — used sparingly for CTAs and active states) */
    --accent:        #6366F1;   /* indigo-500 */
    --accent-hover:  #4F46E5;   /* indigo-600 */
    --accent-soft:   #EEF2FF;   /* indigo-50  */
    --accent-ring:   rgba(99, 102, 241, 0.35);

    /* Semantic */
    --success:       #10B981;
    --success-soft:  #ECFDF5;
    --error:         #EF4444;
    --error-soft:    #FEF2F2;
    --warning:       #F59E0B;

    /* Neutrals */
    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Surfaces */
    --bg:           #FFFFFF;
    --bg-subtle:    #FAFBFC;
    --sidebar-bg:   #FAFBFC;
    --border:       #E8EAED;
    --border-light: #F0F1F3;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Radius */
    --radius-sm: 6px;
    --radius:     10px;
    --radius-lg:  14px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);

    /* Layout */
    --sidebar-width: 264px;
    --topbar-height: 64px;
}

/* ─── Reset ─────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
svg { display: block; }

/* ─── Brand ─────────────────────────────────────────────────────── */

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.brand__mark--lg { width: 52px; height: 52px; font-size: 18px; border-radius: var(--radius); }

/* ─── App Shell ─────────────────────────────────────────────────── */

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

/* ─── Sidebar ───────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-light);
}
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-weight: 700; font-size: 15px; color: var(--gray-900); }
.brand__sub  { font-size: 12px; color: var(--gray-400); }

.sidebar__nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-weight: 500;
    font-size: 13.5px;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}
.nav-item--active {
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-weight: 600;
}
.nav-item--disabled {
    opacity: 0.45;
    pointer-events: none;
}
.nav-item__icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.sidebar__footer {
    padding: 10px;
    border-top: 1px solid var(--border-light);
}
.nav-item--logout:hover {
    background: var(--error-soft);
    color: var(--error);
}

/* ─── Main / Topbar ─────────────────────────────────────────────── */

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: var(--bg);
    flex-shrink: 0;
}
.topbar__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-chip__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}
.user-chip__info { display: flex; flex-direction: column; }
.user-chip__name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.user-chip__role { font-size: 11px; color: var(--gray-400); text-transform: capitalize; }

.content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}

/* ─── Cards ─────────────────────────────────────────────────────── */

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.card__header {
    padding: 20px 24px 0;
}
.card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
}
.card__subtitle {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* ─── Forms ──────────────────────────────────────────────────────── */

.form { padding: 20px 24px 24px; }

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-label__hint {
    font-weight: 400;
    color: var(--gray-400);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-input::placeholder { color: var(--gray-300); }
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-textarea { resize: vertical; min-height: 80px; }

.password-field { position: relative; }
.password-field .form-input { padding-right: 42px; }
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover { color: var(--gray-600); background: var(--gray-100); }

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--accent);
    color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--secondary {
    background: var(--bg);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn--secondary:hover { background: var(--gray-50); }

.btn--block { width: 100%; }

/* ─── Alerts ─────────────────────────────────────────────────────── */

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
}
.alert--success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}
.alert--error {
    background: var(--error-soft);
    color: var(--error);
    border: 1px solid rgba(239,68,68,0.2);
}

/* ─── Badges ─────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge--indigo  { background: var(--accent-soft); color: var(--accent-hover); }
.badge--gray     { background: var(--gray-100); color: var(--gray-600); }
.badge--emerald  { background: var(--success-soft); color: var(--success); }

/* ─── Login Page ─────────────────────────────────────────────────── */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
}

.login-card__brand {
    text-align: center;
    margin-bottom: 28px;
}
.login-card__brand .brand__mark { margin: 0 auto 16px; }
.login-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}
.login-card__subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 6px;
}

.login-form .form-group { margin-bottom: 18px; }
.login-form .btn { margin-top: 6px; }

.login-card__footer-text {
    text-align: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--gray-400);
}

/* ─── Dashboard ───────────────────────────────────────────────────── */

.dash { max-width: 960px; }

.dash__welcome { margin-bottom: 28px; }
.dash__hello {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}
.dash__sub {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-xs);
}
.stat-card__icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-card__icon--indigo  { background: #EEF2FF; color: var(--accent); }
.stat-card__icon--violet  { background: #F5F3FF; color: #8B5CF6; }
.stat-card__icon--amber   { background: #FFFBEB; color: #F59E0B; }
.stat-card__icon--emerald { background: var(--success-soft); color: var(--success); }
.stat-card__body { display: flex; flex-direction: column; }
.stat-card__value { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.stat-card__label { font-size: 12px; color: var(--gray-500); }

/* Section */
.section { margin-bottom: 32px; }
.section__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 14px;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-xs);
}
.action-card:not(.action-card--disabled):hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.action-card--disabled { opacity: 0.5; pointer-events: none; }
.action-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.action-card__body { display: flex; flex-direction: column; }
.action-card__title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.action-card__desc { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* Checklist */
.checklist { list-style: none; padding: 8px 0; }
.checklist__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    font-size: 13.5px;
    color: var(--gray-700);
}
.checklist__item--done { color: var(--gray-400); text-decoration: line-through; }
.checklist__check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.checklist__item--done .checklist__check {
    background: var(--success-soft);
    color: var(--success);
}
.checklist__item:not(.checklist__item--done) .checklist__check {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* ─── Profile ─────────────────────────────────────────────────────── */

.profile { max-width: 860px; }
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    margin-bottom: 20px;
}
.profile-header__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
}
.profile-header__name { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.profile-header__email { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }

/* Meta list */
.meta-list { padding: 8px 24px 16px; }
.meta-list__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
}
.meta-list__row:last-child { border-bottom: none; }
.meta-list__row dt { color: var(--gray-500); font-weight: 500; }
.meta-list__row dd { color: var(--gray-900); font-weight: 500; }

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-grid { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .stat-grid { grid-template-columns: 1fr; }
    .content { padding: 16px; }
}