/* DatAdmin - Custom Styles */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --topbar-height: 56px;
    --primary: #0d6efd;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #e2e8f0;
    --sidebar-hover-bg: #334155;
}

/* Layout */
body {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1040;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand .bi {
    font-size: 1.5rem;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-heading {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    color: var(--sidebar-active);
    background-color: var(--sidebar-hover-bg);
}

.sidebar-link.active {
    color: #fff;
    background-color: var(--primary);
}

.sidebar-link .bi {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.content-wrapper {
    padding: 1.5rem;
}

/* Mobile sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.15s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.table-toolbar {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* Status badges */
.badge-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

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

/* Toast container */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
}

/* HTMX loading indicator */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Filiale selector */
.filiale-selector .dropdown-toggle {
    font-weight: 500;
}

/* Modal overrides */
.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 0.75rem 1.25rem;
}

/* Inline edit row */
tr.editing {
    background-color: #fff3cd !important;
}

/* Progress bar for uploads */
.upload-progress {
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background: #e9ecef;
}

.upload-progress .progress-bar {
    transition: width 0.1s ease;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Tab navigation */
.nav-tabs .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Action buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1;
}

/* Scrollable table wrapper */
.table-responsive {
    border-radius: 0 0 0.75rem 0.75rem;
}
