:root {
    --primary-color: #4f46e5; /* Indigo 600 */
    --primary-hover: #4338ca; /* Indigo 700 */
    --secondary-color: #64748b; /* Slate 500 */
    --success-color: #10b981; /* Emerald 500 */
    --danger-color: #ef4444; /* Red 500 */
    --warning-color: #f59e0b; /* Amber 500 */
    --info-color: #3b82f6; /* Blue 500 */
    --light-bg: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

/* Navbar Overrides */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    box-shadow: var(--shadow-md);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--card-bg);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--light-bg);
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom-width: 1px;
    background-color: var(--light-bg);
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom-color: var(--border-color);
}

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

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Utilities */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded-lg { border-radius: var(--radius-lg) !important; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .nav-link {
      font-size: 1.1rem;
    }
    .navbar-brand {
      font-size: 1.3rem;
    }
    .btn {
      padding: 0.5rem 1rem;
    }
}

/* Extra styles from verkauf.php */
.container-wide {
    max-width: 1800px;
}

.btn-action {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    position: relative;
    padding-bottom: 8px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.03);
}

.status-offen { background: var(--warning-color); }
.status-erledigt { background: var(--success-color); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}


/* Mobile Table Cards from kunden.php */
@media (max-width: 768px) {
    .table-mobile-cards {
        display: block;
    }
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards tbody {
        display: block;
    }
    .table-mobile-cards tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 12px;
        background: var(--card-bg);
        box-shadow: var(--shadow-sm);
    }
    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        text-align: right;
    }
    .table-mobile-cards td:last-child {
        border-bottom: none;
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
    }
    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        flex-shrink: 0;
        margin-right: 10px;
        text-align: left;
    }
    .table-mobile-cards td:last-child::before {
        content: 'Aktionen';
        margin-bottom: 8px;
    }
    .table-mobile-cards .btn-sm {
        width: 100%;
        margin-bottom: 5px;
    }
}


/* Summary Cards from ausgabe.php */
.summary-cards .card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 0;
    box-shadow: var(--shadow-md);
    transition: transform .18s ease, box-shadow .18s ease;
}
.summary-cards .card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.summary-cards .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
}
.summary-cards .icon {
    font-size: 2.25rem;
    opacity: 1;
}
.summary-cards .data .label {
    font-size: .85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .06em;
}
.summary-cards .data .value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-main);
}
.summary-cards .data .sub {
    font-size: .78rem;
    color: var(--text-muted);
}


/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, #7c6ef5 0%, #8aa2ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 12px 30px rgba(12, 15, 30, 0.12);
    border: 1px solid rgba(15,23,42,0.04);
    max-width: 520px;
    width: 100%;
}

.login-card h3 {
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--text-main);
}

.login-btn {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-hover));
    border: none;
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.06rem;
    box-shadow: 0 10px 30px rgba(91,110,246,0.18);
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    width: 100%;
    display: block;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(91,110,246,0.22);
    color: #fff;
}

.passkey-panel {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,0.04);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.passkey-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 64%;
}

.passkey-action {
    margin-left: auto;
}

.passkey-btn {
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 160px;
    box-shadow: none;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.passkey-btn:hover {
    color: #fff;
}

.toggle-pass {
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15,23,42,0.06);
    background: #fff;
    box-shadow: none;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease;
}

.toggle-pass:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(12,15,30,0.08);
}

@media(max-width:576px){
    .login-card { padding: 18px; }
    .login-btn { font-size: 0.98rem; }
    .passkey-panel { flex-direction: column; align-items: stretch; }
    .passkey-action { margin-left: 0; }
}


/* Admin Page Styles */
.admin-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.06);
    overflow: hidden;
    margin-bottom: 2rem;
    background: var(--card-bg);
}

.admin-header {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    padding: 18px 22px;
    border-radius: 14px 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    font-weight: 600;
    font-size: 1.125rem;
    margin: 0;
    color: #fff;
}

.admin-body {
    background: var(--card-bg);
    padding: 22px;
}

.qr-cell img {
    width: 80px;
    height: 80px;
}

@media(max-width:768px) {
    .qr-cell img {
        width: 56px;
        height: 56px;
    }
    .admin-body {
        padding: 12px;
    }
}

