/*
 * Serves Platform - Calm Color Palette
 * Focused on eye-friendly beige/warm tones
 */

:root {
    /* 1. Main Background - Sehr helles Beige / Warmes Off-White (leicht gelblich) */
    --bg-main: #F9F7EF;

    /* 2. Sidebar Background - Gedämpftes Sand-Beige (minimal dunkler) */
    --bg-sidebar: #E8E3D3;

    /* 3. Cards / Input Fields - Cremiges Weiß (warm) */
    --bg-card: #FFFEF8;

    /* 4. Primary Text - Dunkles Oliv-Grau (NICHT schwarz) */
    --text-primary: #3E4037;

    /* 5. Secondary Text / Icons - Staubiges Grau-Olive */
    --text-secondary: #75786A;

    /* 6. Divider / Lines - Sehr helles Warm-Grau (kaum sichtbar) */
    --divider: #EBE9E1;

    /* 7. Accent Color - Gedämpftes Apricot / Soft Orange (subtil, NICHT knallig) */
    --accent: #CFA178;

    /* 8. Hover / Active - Leicht dunkleres Beige (nur Helligkeitsvariation) */
    --hover: #E3DED0;
}

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

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

/* ============================================================================
   LAYOUT
   ============================================================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Sidebar - Floating with rounded corners, full height */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3rem);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.sidebar-nav a:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--hover);
    color: var(--text-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--divider);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-card);
    font-weight: 600;
}

.credits-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.credits-amount {
    color: var(--accent);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0;
}

/* ============================================================================
   COMPONENTS
   ============================================================================ */

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--divider);
}

/* Header */
.page-header {
    margin-bottom: 0;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-card);
}

.btn-primary:hover {
    background: #C19868;
}

.btn-secondary {
    background: var(--bg-sidebar);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--hover);
}

.btn-danger {
    background: #C8927A;
    color: var(--bg-card);
}

.btn-danger:hover {
    background: #B88568;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    border-bottom: 2px solid var(--divider);
}

.table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--divider);
    color: var(--text-primary);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running {
    background: #D4DCC8;
    color: #4A5338;
}

.status-stopped {
    background: var(--divider);
    color: var(--text-secondary);
}

.status-error {
    background: #E0C7BD;
    color: #6B524A;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* ============================================================================
   AUTH PAGES
   ============================================================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-error {
    background: #E0C7BD;
    color: #6B524A;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }

.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
