/* Star Admin 2 Inspired Theme for PKV-Checker
   Using Bootstrap 5 with minimal custom styling */

/* Google Font */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #191c24;
    --sidebar-text: #8e94a9;
    --sidebar-hover: #0d0d12;
    --sidebar-active: #0090e7;
    --navbar-height: 60px;
    --content-bg: #f4f5f7;
}

/* Base */
body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--content-bg);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1030;
    transition: width 0.2s ease;
}

.sidebar .brand {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar .brand a {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-link.active {
    color: var(--sidebar-active);
    position: relative;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--sidebar-active);
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* Sidebar Submenu */
.sidebar .collapse .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.top-navbar {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid #e8ebf1;
}

.content-wrapper {
    padding: 1.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
}

/* Dashboard Summary Cards */
.summary-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Priority borders */
.priority-1 { border-left: 4px solid #fc424a; }
.priority-2 { border-left: 4px solid #f5a623; }
.priority-3 { border-left: 4px solid #00d2d3; }

/* Activity items */
.activity-item {
    border-left: 3px solid #e8ebf1;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

.activity-item.receipt { border-left-color: #0090e7; }
.activity-item.submission { border-left-color: #00d25b; }
.activity-item.statement { border-left-color: #8f5fe8; }
.activity-item.payment { border-left-color: #00d2d3; }
.activity-item.settlement { border-left-color: #f5a623; }

/* Progress bars */
.progress-thin {
    height: 6px;
    border-radius: 3px;
}

/* Buttons */
.btn {
    white-space: nowrap;
}

.btn-primary {
    background-color: #0090e7;
    border-color: #0090e7;
}

.btn-primary:hover {
    background-color: #007bcc;
    border-color: #007bcc;
}

.btn-success {
    background-color: #00d25b;
    border-color: #00d25b;
}

.btn-warning {
    background-color: #ffab00;
    border-color: #ffab00;
}

.btn-danger {
    background-color: #fc424a;
    border-color: #fc424a;
}

.btn-info {
    background-color: #8f5fe8;
    border-color: #8f5fe8;
}

/* Tables */
.table > thead {
    background-color: #f8f9fa;
}

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

/* Badges - Star Admin 2 style */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Form controls */
.form-control, .form-select {
    border-color: #e8ebf1;
}

.form-control:focus, .form-select:focus {
    border-color: #0090e7;
    box-shadow: 0 0 0 0.2rem rgba(0, 144, 231, 0.15);
}

/* Login page specific */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #191c24 0%, #2c3e50 100%);
}

.auth-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
}

/* Responsive */
@media (max-width: 991.98px) {
    /* Prevent horizontal overflow on mobile */
    html, body {
        overflow-x: hidden;
    }

    .sidebar {
        transform: translateX(-100%);
        visibility: hidden;
    }

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

    .main-panel {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: block;
    }

    /* Responsive tables - horizontal scroll */
    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .content-wrapper .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Content wrapper adjustments */
    .content-wrapper {
        padding: 1rem;
    }

    /* Filter form on mobile - stack vertically */
    .filter-form .row {
        flex-direction: column;
    }

    .filter-form .col-auto {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Action buttons on mobile */
    .btn-group-mobile {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .btn-group-mobile .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .content-wrapper {
        padding: 0.75rem;
    }

    /* Smaller font for tables on mobile */
    .table {
        font-size: 0.85rem;
    }

    .table th, .table td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }

    /* Hide less important columns on very small screens */
    .table .d-none-xs {
        display: none !important;
    }
}

/* Footer */
.footer {
    background: #fff;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e8ebf1;
    color: #8e94a9;
    font-size: 0.875rem;
}

/* Dropdown menus */
.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f4f5f7;
}

/* User dropdown in navbar */
.user-dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: #3e4657;
    border-radius: 3px;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #0d0d0d;
    font-weight: 600;
}

/* HTMX Indicator - FEATURE-0025: Infinite Scroll */
/* Skeleton-Loader nur während HTMX-Request sichtbar */
.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}
