/* ============================
   CSS Custom Properties
   ============================ */
:root {
    --color-sidebar-bg: #1e293b;
    --color-sidebar-text: #94a3b8;
    --color-sidebar-text-hover: #f1f5f9;
    --color-sidebar-active: #3b82f6;
    --color-sidebar-active-bg: rgba(59, 130, 246, 0.15);
    --color-sidebar-logo: #f1f5f9;

    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;

    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    --sidebar-width: 240px;
    --header-height: 60px;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);

    --transition: 0.2s ease;
}

/* ============================
   Reset & Base
   ============================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================
   Layout
   ============================ */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ============================
   Sidebar
   ============================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar__logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__logo-text {
    color: var(--color-sidebar-logo);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar__nav {
    padding: 12px 0;
    flex: 1;
}

.nav-list {
    list-style: none;
    padding: 0 8px;
}

.nav-list__item {
    margin-bottom: 2px;
}

.nav-list__link {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--color-sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.nav-list__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-sidebar-text-hover);
    text-decoration: none;
}

.nav-list__link--active {
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-active);
}

/* ============================
   Main Area
   ============================ */
.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================
   Header
   ============================ */
.header {
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================
   Content
   ============================ */
.content {
    flex: 1;
    padding: 24px;
}

/* ============================
   Messages
   ============================ */
.messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.message--success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.message--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.message--warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.message--info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

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

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

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}
