/* ArchitectUI Admin Theme - Modern Dashboard Design */

/* ===== ROOT VARIABLES ===== */
:root {
    /* TailAdmin Color Scheme */
    --primary-color: #3c50e0;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #f87171;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1c2434;
    --light-color: #f1f5f9;
    --white: #ffffff;
    --muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-bg: #1c2434;
    --sidebar-text: #8a99af;
    --sidebar-active: #3c50e0;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --header-height: 72px;
    --sidebar-width: 280px;
    --content-padding: 24px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --text-body: #64748b;
    --text-title: #1c2434;
    --bg-gray: #f8fafc;
    --bg-gray-2: #f1f5f9;
}

/* ===== BODY & BASE LAYOUT ===== */
body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-gray);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    font-weight: 400;
}

.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-gray);
}

/* ===== SIDEBAR STYLING ===== */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 9999;
    overflow-y: auto;
    transition: all 0.3s ease;
    border-right: 1px solid #313d4a;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background-color: #313d4a;
    border-radius: 2px;
}

.sidebar-header {
    padding: 30px 28px 30px;
    border-bottom: 1px solid #313d4a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Mobile Close Button in Sidebar */
#sidebarClose {
    display: none;
    color: var(--sidebar-text);
    padding: 8px;
    background: none;
    border: none;
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 44px;
    min-width: 44px;
}

#sidebarClose:hover {
    color: var(--white);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.show {
    display: block !important;
    opacity: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: var(--white);
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand:hover {
    color: var(--white);
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 28px;
    margin-right: 12px;
    color: var(--primary-color);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 20px 0 20px 0;
}

.nav-section-title {
    color: #5a6c7d;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 40px 28px 16px;
    padding-left: 0;
}

.nav-section-title:first-child {
    margin-top: 20px;
}

.sidebar-nav .nav-item {
    margin: 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 28px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0;
    font-size: 16px;
    font-weight: 500;
    margin: 2px 0;
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 48px; /* Vergrößerte Touch-Targets für Navigation */
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link:active {
    background-color: #313d4a;
    color: var(--white);
    outline: none;
}

.sidebar-nav .nav-link:active {
    background-color: #2a3440;
    transition: none;
}

.sidebar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 16px;
    text-align: center;
    font-size: 18px;
    color: inherit;
}

/* ===== MAIN CONTENT AREA ===== */
.app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* Header */
.app-header {
    background: var(--white);
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile Sidebar Toggle Button */
#sidebarToggle {
    color: var(--text-title);
    background: none;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius);
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#sidebarToggle:hover {
    background-color: var(--bg-gray);
    color: var(--primary-color);
}

#sidebarToggle:active {
    transform: scale(0.95);
    background-color: var(--primary-color);
    color: white;
    transition: transform 0.1s ease;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-title);
    margin: 0;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-body);
    margin: 4px 0 0;
    font-weight: 400;
}

.page-breadcrumb {
    font-size: 14px;
    color: var(--text-body);
    margin: 0;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* User Dropdown */
.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--dark-color);
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-dropdown .dropdown-toggle:hover {
    background-color: #f8f9fa;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 8px;
}

.user-dropdown .dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 200px;
}

.user-dropdown .dropdown-item {
    padding: 12px 20px; /* Vergrößert für bessere Touch-Targets */
    display: flex;
    align-items: center;
    color: var(--dark-color);
    transition: all 0.3s ease;
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 44px; /* Apple's empfohlene Touch-Target-Größe */
}

.user-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.user-dropdown .dropdown-item i {
    width: 18px;
    margin-right: 10px;
}

/* ===== CONTENT AREA ===== */
.app-content {
    padding: var(--content-padding);
    background: var(--bg-gray);
    min-height: calc(100vh - var(--header-height));
}

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: 24px;
    background: var(--white);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-title);
    margin: 0;
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-body);
    margin: 4px 0 0;
    font-weight: 400;
}

.card-body {
    padding: 24px;
}

.card-compact {
    margin-bottom: 20px;
}

.card-compact .card-header {
    padding: 16px 20px;
}

.card-compact .card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--white);
    box-shadow: var(--card-shadow);
}

.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card-body {
    padding: 24px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.bg-primary {
    background-color: var(--primary-color);
}

.stat-icon.bg-success {
    background-color: var(--success-color);
}

.stat-icon.bg-warning {
    background-color: var(--warning-color);
}

.stat-icon.bg-danger {
    background-color: var(--danger-color);
}

.stat-icon.bg-info {
    background-color: var(--info-color);
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-title);
    margin: 0 0 4px;
    line-height: 1.2;
}

.stat-content p {
    font-size: 14px;
    color: var(--text-body);
    margin: 0;
    font-weight: 500;
}

.stat-trend {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    margin-top: 8px;
    display: inline-block;
}

.stat-trend.up {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-trend.down {
    background-color: rgba(248, 113, 113, 0.1);
    color: var(--danger-color);
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    background-image: none;
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 44px; /* Apple's empfohlene Touch-Target-Größe */
    min-width: 44px;
    justify-content: center;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.15);
}

.btn:active {
    transform: translateY(1px);
    transition: none;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Primary Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2542d8;
    border-color: #2542d8;
    color: white;
}

/* Secondary Buttons */
.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
    border-color: #475569;
    color: white;
}

/* Success Buttons */
.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    border-color: #059669;
    color: white;
}

/* Warning Buttons */
.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background-color: #d97706;
    border-color: #d97706;
    color: white;
}

/* Danger Buttons */
.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* Info Buttons */
.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: white;
}

.btn-info:hover:not(:disabled) {
    background-color: #0891b2;
    border-color: #0891b2;
    color: white;
}

/* Outline Buttons */
.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
}

.btn-outline-secondary:hover:not(:disabled) {
    background-color: var(--secondary-color);
    color: white;
}

.btn-outline-success {
    border-color: var(--success-color);
    color: var(--success-color);
    background: transparent;
}

.btn-outline-success:hover:not(:disabled) {
    background-color: var(--success-color);
    color: white;
}

.btn-outline-warning {
    border-color: var(--warning-color);
    color: var(--warning-color);
    background: transparent;
}

.btn-outline-warning:hover:not(:disabled) {
    background-color: var(--warning-color);
    color: white;
}

.btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: transparent;
}

.btn-outline-danger:hover:not(:disabled) {
    background-color: var(--danger-color);
    color: white;
}

.btn-outline-info {
    border-color: var(--info-color);
    color: var(--info-color);
    background: transparent;
}

.btn-outline-info:hover:not(:disabled) {
    background-color: var(--info-color);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px; /* Vergrößert für bessere Touch-Targets */
    font-size: 12px;
    border-radius: 6px;
    min-height: 40px; /* Mindesthöhe für Touch */
}

.btn-lg {
    padding: 16px 32px; /* Vergrößert für bessere Touch-Targets */
    font-size: 16px;
    border-radius: 8px;
    min-height: 52px; /* Größere Touch-Targets für große Buttons */
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    position: relative;
    flex: 1 1 auto;
    margin-right: 1px;
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--border-radius);
    border-bottom-left-radius: var(--border-radius);
}

.btn-group .btn:last-child {
    margin-right: 0;
    border-top-right-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.btn-group-sm .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-body);
    background-color: var(--white);
    border-collapse: collapse;
}

.table thead th {
    background: var(--bg-gray-2);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 500;
    color: var(--text-title);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: none;
    vertical-align: middle;
}

.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.5;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--bg-gray);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-modern {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

/* ===== BADGES ===== */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    text-transform: capitalize;
    letter-spacing: 0.25px;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background-color: rgba(248, 113, 113, 0.1);
    color: #dc2626;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-primary {
    background-color: rgba(60, 80, 224, 0.1);
    color: #3730a3;
    border: 1px solid rgba(60, 80, 224, 0.2);
}

.badge-info {
    background-color: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-secondary {
    background-color: rgba(100, 116, 139, 0.1);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* ===== FORMS ===== */
.form-label {
    font-weight: 500;
    color: var(--text-title);
    margin-bottom: 8px;
    font-size: 14px;
    display: block;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: var(--white);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-body);
    width: 100%;
    display: block;
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* Apple's empfohlene Touch-Target-Größe */
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.1);
    background-color: var(--white);
    outline: none;
}

.form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    background-color: var(--white);
    font-size: 16px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    color: var(--text-body);
    width: 100%;
    display: block;
    /* Touch-optimierte Eigenschaften für iOS */
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* Apple's empfohlene Touch-Target-Größe */
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(60, 80, 224, 0.1);
    outline: none;
}

/* ===== MODALS ===== */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-title {
    font-weight: 600;
    color: var(--dark-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: -30px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--border-color));
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-badge {
    position: absolute;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.timeline-content {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--white);
}

.timeline-header {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 8px;
}

.timeline-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .app-sidebar {
        width: 80%;
        max-width: 320px;
        transform: translateX(-100%);
        z-index: 99999;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .app-sidebar.show {
        transform: translateX(0);
    }
    
    .app-main {
        margin-left: 0;
        width: 100%;
    }
    
    /* Show close button on mobile */
    #sidebarClose {
        display: block !important;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Page-subtitle Optimierung für Tablets */
    .page-subtitle {
        font-size: 15px;
        line-height: 1.3;
        max-width: 400px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Improve sidebar overlay */
    #sidebarOverlay {
        z-index: 99998;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-header {
        padding: 24px 20px;
    }
    
    .sidebar-nav .nav-link {
        padding: 16px 28px; /* Größere Touch-Targets auf mobilen Geräten */
        min-height: 56px;
    }
}

@media (max-width: 768px) {
    .app-content {
        padding: 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    /* Mobile Optimierung für page-subtitle */
    .page-subtitle {
        font-size: 14px;
        line-height: 1.4;
        /* Text abschneiden wenn zu lang */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 300px;
    }
    
    .card-compact .card-header {
        padding: 12px 16px;
    }
    
    .card-compact .card-body {
        padding: 16px;
    }
    
    /* Header Actions Mobile Optimierung */
    .app-header {
        padding: 0 16px;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .header-actions {
        flex-shrink: 0;
        gap: 8px;
        min-width: 0;
        overflow: hidden;
    }
    
    .header-actions .btn {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .header-actions .btn-outline-primary {
        font-size: 0; /* Verstecke Text, zeige nur Icon */
        padding: 10px;
    }
    
    .header-actions .btn-outline-primary i {
        font-size: 16px;
    }
    
    .user-dropdown .dropdown-toggle {
        padding: 6px 8px;
        font-size: 14px;
        min-width: 0;
    }
    
    .user-dropdown .dropdown-toggle .d-none.d-sm-inline {
        display: none !important; /* Verstecke Username auf Mobile */
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        margin-right: 4px;
    }
    
    .page-title-container {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .page-title {
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .table thead th,
    .table tbody td {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 2px;
        border-radius: var(--border-radius);
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Mobile Card Header Button Optimierungen */
@media (max-width: 768px) {
    /* Card Header spezifische Button-Optimierungen */
    .card-header .btn-primary,
    .card-header .btn-secondary,
    .card-header .btn-success,
    .card-header .btn-outline-primary {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 20px;
        font-size: 15px;
        font-weight: 500;
        border-radius: 8px;
        transition: all 0.2s ease;
        cursor: pointer;
        position: relative;
        z-index: 10;
        
        /* iOS Touch Optimierungen */
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        
        /* Bessere Sichtbarkeit */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .card-header .btn-primary:active {
        transform: scale(0.98);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    /* Flexbox-Optimierung für Card Header */
    .card-header.d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .card-header .card-title {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }
    
    .card-header .btn {
        flex-shrink: 0;
        margin-left: auto;
    }
}

/* ===== UTILITIES ===== */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-muted { color: var(--muted) !important; }

.bg-light-primary { background-color: rgba(63, 106, 216, 0.1) !important; }
.bg-light-success { background-color: rgba(0, 214, 143, 0.1) !important; }
.bg-light-warning { background-color: rgba(255, 170, 0, 0.1) !important; }
.bg-light-danger { background-color: rgba(255, 61, 113, 0.1) !important; }

/* Gap Utility Classes for TailAdmin Button Spacing */
.gap-1 {
    gap: 4px !important;
}

.gap-2 {
    gap: 8px !important;
}

.gap-3 {
    gap: 12px !important;
}

.gap-4 {
    gap: 16px !important;
}

.gap-5 {
    gap: 20px !important;
}

/* ===== MODERN UTILITY CLASSES ===== */
.rounded-modern {
    border-radius: var(--border-radius) !important;
}

.shadow-modern {
    box-shadow: var(--card-shadow) !important;
}

.shadow-hover:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.border-modern {
    border: 1px solid var(--border-color) !important;
}

.text-compact {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* TailAdmin specific utilities */
.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

.text-title {
    color: var(--text-title) !important;
}

.text-body {
    color: var(--text-body) !important;
}

.bg-gray {
    background-color: var(--bg-gray) !important;
}

.bg-gray-2 {
    background-color: var(--bg-gray-2) !important;
}

.border-stroke {
    border-color: var(--border-color) !important;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #2952d3;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== iOS TOUCH OPTIMIERUNGEN ===== */

/* Allgemeine iOS-Optimierungen */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Verbesserte Touch-Targets für kleine Elemente */
.btn-sm,
.btn-xs,
.close,
.btn-outline,
.badge,
.tag {
    min-height: 40px !important;
    min-width: 40px !important;
}

/* Optimierte Hover-States für Touch-Geräte */
@media (hover: none) and (pointer: coarse) {
    /* Auf Touch-Geräten Hover-Effekte durch Touch-Feedback ersetzen */
    .btn:hover,
    .nav-link:hover,
    .dropdown-item:hover,
    .table tbody tr:hover {
        transform: none;
        transition: background-color 0.1s ease;
    }
    
    /* Aktive Zustände für besseres Touch-Feedback */
    .btn:active,
    .nav-link:active,
    .dropdown-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Verbesserte Scrolling-Performance auf iOS */
.table-responsive,
.modal-body,
.sidebar-nav {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Verhindert ungewolltes Zoomen bei Input-Focus auf iOS */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important; /* Verhindert Zoom bei Focus */
    }
}

/* Verbesserte Mobile Navigation */
@media (max-width: 768px) {
    .sidebar-nav .nav-link {
        padding: 16px 28px; /* Größere Touch-Targets auf mobilen Geräten */
        min-height: 56px;
    }
    
    .btn {
        min-height: 48px; /* Größere Buttons auf mobilen Geräten */
        padding: 12px 20px;
    }
    
    .btn-sm {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .btn-lg {
        min-height: 56px;
        padding: 18px 36px;
    }
}

/* Extra Mobile Optimierung für kleine Bildschirme (Hochformat) */
@media (max-width: 480px) {
    .app-header {
        padding: 0 12px;
        height: 60px;
    }
    
    /* Header Actions kompakter machen */
    .header-actions {
        gap: 4px;
        flex-shrink: 0;
        max-width: 120px; /* Begrenzte Breite für Header Actions */
    }
    
    .header-actions .btn {
        padding: 6px;
        min-width: 36px;
        min-height: 36px;
        font-size: 0; /* Verstecke allen Text */
    }
    
    .header-actions .btn i {
        font-size: 14px;
    }
    
    /* User Dropdown noch kompakter */
    .user-dropdown .dropdown-toggle {
        padding: 4px 6px;
        min-width: 36px;
    }
    
    .user-dropdown .dropdown-toggle span {
        display: none !important; /* Verstecke Username komplett */
    }
    
    .user-dropdown .dropdown-toggle .bi-chevron-down {
        display: none; /* Verstecke Dropdown-Arrow */
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
        margin-right: 0;
        font-size: 11px;
    }
    
    /* Page Title Container optimieren */
    .page-title-container {
        flex: 1;
        min-width: 0;
        margin-left: 8px;
        margin-right: 8px;
    }
    
    /* Page Header mit Buttons - Umbruch für Mobile */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }
    
    .d-flex.justify-content-between.align-items-center > div:first-child {
        text-align: left;
        width: 100%;
    }
    
    .d-flex.justify-content-between.align-items-center > div:last-child {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Button Groups in zweiter Zeile */
    .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 8px !important;
        justify-content: flex-start;
        width: 100%;
    }
    
    .d-flex.gap-2 .btn {
        flex-shrink: 0;
        min-width: auto;
        font-size: 14px;
        padding: 8px 16px;
        margin: 2px 0;
    }
    
    /* Verhindere Button-Überlauf */
    .d-flex.gap-2 .btn {
        max-width: calc(50% - 4px); /* Maximal 2 Buttons pro Zeile */
        text-overflow: ellipsis;
        overflow: hidden;
    }
    
    .page-title {
        font-size: 18px;
        line-height: 1.2;
    }
    
    .page-subtitle {
        display: none; /* Verstecke Subtitle komplett */
    }
    
    .page-breadcrumb {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Sidebar Toggle Button */
    #sidebarToggle {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
        margin-right: 4px;
    }
}

/* Sehr schmale Bildschirme (iPhone SE, etc.) */
@media (max-width: 375px) {
    .app-header {
        padding: 0 8px;
    }
    
    .header-actions {
        max-width: 80px; /* Noch kleinere Header Actions */
        gap: 2px;
    }
    
    /* Page Header Button Groups noch kompakter */
    .d-flex.gap-2 .btn {
        font-size: 0; /* Verstecke Text komplett */
        padding: 8px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .d-flex.gap-2 .btn i {
        font-size: 14px;
    }
    
    /* Button Text per Tooltip ersetzen */
    .d-flex.gap-2 .btn[title] {
        position: relative;
    }
    
    .header-actions .btn {
        padding: 4px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .header-actions .btn i {
        font-size: 12px;
    }
    
    .user-dropdown .dropdown-toggle {
        padding: 4px;
        min-width: 32px;
    }
    
    .user-avatar {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    #sidebarToggle {
        min-width: 36px;
        min-height: 36px;
        padding: 6px;
    }
    
    #sidebarToggle i {
        font-size: 16px;
    }
}

/* Medium Mobile - Tablet Portrait */
@media (max-width: 600px) {
    /* Page Header Layout Optimierung */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px;
    }
    
    .d-flex.justify-content-between.align-items-center > div:first-child {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .d-flex.justify-content-between.align-items-center > div:last-child {
        width: 100%;
    }
    
    /* Button Groups Optimierung */
    .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 6px !important;
        width: 100%;
        justify-content: flex-start;
    }
    
    .d-flex.gap-2 .btn {
        flex: 0 0 auto;
        font-size: 13px;
        padding: 10px 14px;
        min-height: 40px;
        white-space: nowrap;
    }
    
    /* Page Title responsiver machen */
    .page-title {
        font-size: 22px;
        line-height: 1.3;
    }
    
    .page-subtitle {
        font-size: 14px;
        line-height: 1.4;
        margin-top: 4px;
    }
}
