/* Konzeptberatung — Backoffice
 *
 * Design-Tokens 1:1 aus dem KassenKompass-Design-System uebernommen
 * (`/var/www/kassenkompass-test/static/css/style.css`).
 * Layout-Pattern in KKK ist Top-Navbar (statt KKB-Sidebar) — alles
 * andere ist visuell konsistent zum KKB-Look-and-Feel.
 */

:root {
    /* Primary — Dunkel-Lila */
    --primary: #2D1A5B;
    --primary-dark: #1a0f3a;
    --primary-light: #d8d4eb;
    --primary-50: #F8F5F4;

    /* Accent */
    --accent-teal: #14B8A6;

    /* Status */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Backgrounds — Beige/Warm */
    --bg-page: #f0ece7;
    --bg-card: #F8F5F4;
    --bg-muted: #ebe7e2;
    --bg-hover: #ebe7e2;

    /* Text — Dunkel-Lila */
    --text-heading: #2D1A5B;
    --text-body: #2D1A5B;
    --text-muted: #6b6780;
    --text-disabled: #8a8698;

    /* Borders — Warm */
    --border: #C5C9DC;
    --border-muted: #d8d4eb;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    /* Geometrie — groesser/runder als Bootstrap-Default */
    --radius-sm: 10px;
    --radius-md: 10px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-feature-settings: "ss01", "cv11", "tnum";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.5;
}

main.container {
    flex: 1 0 auto;
    padding-top: 2rem;
    padding-bottom: 4rem;
    max-width: 1280px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -.01em;
    margin-top: 0;
}

h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.375rem; line-height: 1.3; }
h3 { font-size: 1.05rem; line-height: 1.35; }

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

code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .85em;
    color: var(--text-muted);
    background: var(--bg-muted);
    padding: .15em .45em;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Top-Navbar (KKK-spezifisch — KKB hat Sidebar)
   ========================================================================== */

.navbar {
    background: var(--primary) !important;
    border-bottom: 1px solid var(--primary-dark);
    box-shadow: var(--shadow-sm);
    padding-top: .75rem;
    padding-bottom: .75rem;
}

.navbar .container {
    max-width: 1280px;
}

.navbar .navbar-brand {
    font-weight: 700;
    color: #fff !important;
    font-size: 1.1rem;
    letter-spacing: -.015em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar .navbar-brand::before {
    content: "◆";
    color: var(--accent-teal);
    font-size: .8em;
}

.navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .92);
    font-weight: 500;
    font-size: .8rem;
    padding: .35rem .85rem;
    border-radius: var(--radius-sm);
}
.navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
}

/* ==========================================================================
   Page-Header
   ========================================================================== */

.kk-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.kk-page-header h1 {
    margin: 0 0 .35rem 0;
}

.kk-page-header .kk-subtitle {
    color: var(--text-muted);
    font-size: .9rem;
    margin: 0;
}

.kk-page-header .kk-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--bg-card);
    border: 1px solid #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    background: var(--bg-muted);
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

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

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

.btn-outline-secondary {
    background: var(--bg-card);
    color: var(--text-body);
    border-color: var(--border);
}
.btn-outline-secondary:hover {
    background: var(--bg-muted);
    border-color: var(--text-muted);
    color: var(--text-heading);
}

.btn-outline-danger {
    background: var(--bg-card);
    color: var(--error);
    border-color: var(--border);
}
.btn-outline-danger:hover {
    background: var(--error);
    border-color: var(--error);
    color: #fff;
}

.btn-outline-success {
    background: var(--bg-card);
    color: var(--success);
    border-color: var(--border);
}
.btn-outline-success:hover {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-link {
    color: var(--text-muted);
    text-decoration: none;
}
.btn-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table {
    margin-bottom: 0;
    color: var(--text-body);
    font-size: 14px;
}

.table thead th {
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 12px 16px;
}

.table tbody td {
    border-color: var(--border-muted);
    vertical-align: middle;
    padding: 14px 16px;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table-success {
    --bs-table-bg: var(--success-light);
    --bs-table-color: var(--text-body);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.form-control, .form-select {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 26, 91, .12);
    outline: none;
}

.form-text {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-top: 5px;
}

.form-check-input {
    border-color: var(--border);
    width: 1.05em;
    height: 1.05em;
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-label {
    color: var(--text-body);
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 13.5px;
}
.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-color: rgba(16, 185, 129, .25);
}
.alert-danger {
    background: var(--error-light);
    color: #991b1b;
    border-color: rgba(239, 68, 68, .25);
}
.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-color: rgba(245, 158, 11, .3);
}
.alert-info {
    background: var(--info-light);
    color: #1e40af;
    border-color: rgba(59, 130, 246, .25);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 4px 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: var(--radius-sm);
}
.badge.bg-success { background: var(--success-light) !important; color: #065f46 !important; }
.badge.bg-danger { background: var(--error-light) !important; color: #991b1b !important; }
.badge.bg-warning { background: var(--warning-light) !important; color: #92400e !important; }
.badge.bg-info { background: var(--primary-light) !important; color: var(--primary) !important; }
.badge.bg-secondary { background: var(--bg-muted) !important; color: var(--text-muted) !important; border: 1px solid var(--border); }
.badge.bg-light { background: var(--bg-muted) !important; color: var(--text-muted) !important; }

/* ==========================================================================
   Empty-State
   ========================================================================== */

.kk-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.kk-empty-icon {
    font-size: 2.5rem;
    color: var(--text-disabled);
    margin-bottom: 1rem;
    opacity: .6;
}
.kk-empty-title {
    font-size: 1.05rem;
    color: var(--text-heading);
    margin-bottom: .5rem;
    font-weight: 600;
}

/* ==========================================================================
   List-Group
   ========================================================================== */

.list-group {
    border-radius: var(--radius-md);
    overflow: hidden;
}
.list-group-item {
    border-color: var(--border-muted);
    color: var(--text-body);
    background: var(--bg-card);
    padding: 12px 16px;
}

/* ==========================================================================
   Tile (Einstieg)
   ========================================================================== */

.kk-tile {
    background: var(--bg-card);
    border: 1px solid #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-body);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: var(--shadow-card);
}
.kk-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: var(--text-body);
}
.kk-tile-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    font-weight: 700;
}
.kk-tile h2 {
    margin-bottom: .35rem;
    font-size: 1.05rem;
}

/* ==========================================================================
   Hero / Result-Highlight
   ========================================================================== */

.kk-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #4a2d8c 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}
.kk-hero h1, .kk-hero h2, .kk-hero p {
    color: #fff;
}

/* ==========================================================================
   Misc
   ========================================================================== */

hr {
    color: var(--border);
    opacity: 1;
    margin: 1.5rem 0;
}

.text-muted, .text-secondary {
    color: var(--text-muted) !important;
}

.text-success { color: var(--success) !important; }
.text-danger { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }

.text-subtle { color: var(--text-disabled) !important; }
