/* =====================================================================
   Personalplan für Fitnessclubs — Styles
   Look-and-Feel aus dem Media Motion Dashboard portiert.
   ===================================================================== */

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

:root {
    --bg:              #f0f2f5;
    --header-bg:       #0a0a1a;
    --sidebar-bg:      #ffffff;
    --card-bg:         #ffffff;
    --text:            #1a1a2e;
    --text-secondary:  #636e72;
    --border:          rgba(0, 0, 0, 0.08);
    --accent:          #6c5ce7;
    --accent-light:    #a29bfe;
    --red:             #e74c3c;
    --orange:          #e67e22;
    --yellow:          #f0c929;
    --blue:            #3b82f6;
    --purple:          #8b5cf6;
    --green:           #22c55e;
    --radius:          12px;
    --radius-lg:       16px;
    --shadow:          0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover:    0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-modal:    0 24px 80px rgba(0, 0, 0, 0.25);
    --transition:      0.2s ease;
    --sidebar-w:       240px;
    --header-h:        60px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────────────────── */
.header {
    background: var(--header-bg);
    padding: 0 28px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    color: #fff;
}
.logo { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.logo span {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-right { display: flex; gap: 12px; align-items: center; }
.header-user { font-size: 14px; opacity: 0.85; }

/* ── Layout: Sidebar + Main ─────────────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: calc(100vh - var(--header-h));
}
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
}
.sidebar-section {
    padding: 0 16px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}
.sidebar-link:hover { background: rgba(108, 92, 231, 0.06); }
.sidebar-link.active {
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}
.main {
    padding: 28px;
    max-width: 100%;
    overflow-x: auto;
}
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ── Card / Panel ──────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform 0.05s ease;
    text-decoration: none;
    color: var(--text);
    background: rgba(0, 0, 0, 0.04);
}
.btn:hover { background: rgba(0, 0, 0, 0.08); }
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #5947d3; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-ghost { background: transparent; border-color: var(--border); }
.filter-btn { background: #fff; border-color: var(--border); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.form-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 6px;
}

/* ── Login-Seite ───────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
    padding: 24px;
}
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-modal);
}
.login-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.login-card .login-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}
.login-card .btn-primary { width: 100%; padding: 12px; }
.login-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}
.login-link a { color: var(--accent); text-decoration: none; }

/* ── Badge / Tag ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text);
}
.badge-success  { background: rgba(34, 197, 94, 0.15);  color: #15803d; }
.badge-warning  { background: rgba(240, 201, 41, 0.2);  color: #b45309; }
.badge-danger   { background: rgba(231, 76, 60, 0.15);  color: #b91c1c; }
.badge-info     { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 18px;
    background: var(--text);
    color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-modal);
    font-size: 14px;
    font-weight: 500;
    animation: toast-in 0.25s ease;
    min-width: 240px;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
@keyframes toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Tabellen ──────────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.table tr:hover { background: rgba(0, 0, 0, 0.02); }

/* ── Sidebar-Toggle (Hamburger) ──────────────────────────────── */
.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    padding: 4px 10px;
    cursor: pointer;
    margin-right: 8px;
}
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(10, 10, 26, 0.45);
    z-index: 90;
}
.sidebar-backdrop.active { display: block; }

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

/* Tablet & Mobile: Sidebar wird zum slide-in Drawer */
@media (max-width: 1024px) {
    .sidebar-toggle { display: inline-block; }
    .layout { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        width: 280px;
        background: #fff;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
        height: auto;
        overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-link { padding: 14px 24px; font-size: 15px; }  /* größere Touch-Targets */
    .main { padding: 16px; }
    .page-title { font-size: 20px; }
    .header { padding: 0 16px; }
    .header-user { font-size: 13px; }
    .header-user strong { display: block; }
    .card { padding: 16px; }
}

/* Mobile: tighter Layout */
@media (max-width: 640px) {
    .main { padding: 12px; }
    .card { padding: 14px; border-radius: 12px; }
    .page-title { font-size: 18px; }
    .header { padding: 0 12px; height: 56px; }
    .header-user { font-size: 12px; max-width: 50vw; overflow: hidden; text-overflow: ellipsis; }
    .logo { font-size: 17px; }
    /* Tables horizontal scrollbar */
    .card { overflow-x: auto; }
    .table { font-size: 13px; min-width: 480px; }
    .table th, .table td { padding: 8px 10px; }
    /* Buttons touchier */
    .btn { padding: 12px 16px; font-size: 14px; min-height: 44px; }
    /* Modal: full-screen-ish */
    .modal-box { margin: 8px; max-height: 95vh; }
    /* Form inputs touchier */
    .form-input, .form-select, .form-textarea { padding: 12px 14px; font-size: 16px; /* iOS no zoom */ }
    /* Login card centered */
    .login-card { padding: 28px 20px; }
    /* Calendar grids: erlaube horizontal scroll */
    .cal-wrap { min-width: 720px; }
}

/* Drucker — Sidebar verbergen */
@media print {
    .sidebar, .sidebar-toggle, .header, .toast-container { display: none !important; }
    .main { padding: 0; }
}
