/**
 * Neumann & Partner Fussboden - Verwaltungssoftware
 * Hauptstylsheet mit Corporate Design
 *
 * Corporate Colors:
 * - Primär: #2B4C7E (Dunkelblau)
 * - Sekundär: #E63946 (Rot)
 * - Akzent: #1a3460 (Noch dunkler Blau)
 */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f0f2f5;
    background-image:
        radial-gradient(at 0% 0%, rgba(43, 76, 126, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(230, 57, 70, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ========================================
   VARIABLES & COLORS
   ======================================== */

:root {
    --primary-color: #2B4C7E;
    --primary-dark: #1a3460;
    --primary-light: #3d6ba8;
    --secondary-color: #E63946;
    --secondary-dark: #c72f3a;
    --secondary-light: #f04e59;

    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;

    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;

    --border-color: #ddd;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --header-height: 70px;
    --nav-width: 260px;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page,
.change-password-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(43, 76, 126, 0.95) 0%, rgba(26, 52, 96, 0.98) 100%),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="white" stroke-opacity="0.05" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    background-size: cover, 20px 20px;
    animation: subtleShift 20s ease-in-out infinite;
}

@keyframes subtleShift {
    0%, 100% { background-position: 0% 0%, 0 0; }
    50% { background-position: 100% 100%, 10px 10px; }
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-md);
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-xl);
    text-align: center;
}

.login-logo {
    height: 100px;
    width: auto;
    margin-bottom: var(--spacing-md);
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.login-header p {
    font-size: 0.9rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.login-form {
    padding: var(--spacing-xl);
}

.login-footer {
    background: #f9f9f9;
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e1e4e8;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(43, 76, 126, 0.1), 0 2px 8px rgba(43, 76, 126, 0.15);
    transform: translateY(-1px);
}

.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus),
.form-group textarea:hover:not(:focus) {
    border-color: rgba(43, 76, 126, 0.3);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-row {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-sm);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.form-check-input:hover + .form-check-label {
    color: var(--primary-color);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(43, 76, 126, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0f1f3d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 76, 126, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(230, 57, 70, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #a52229 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.btn-warning {
    background: var(--warning-color);
    color: #333;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-outline-primary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(43, 76, 126, 0.1);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(43, 76, 126, 0.3);
}

.btn-outline-secondary {
    background: white;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    box-shadow: 0 2px 4px rgba(230, 57, 70, 0.1);
}

.btn-outline-secondary:hover:not(:disabled) {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-dark);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.btn-outline-danger {
    background: white;
    color: var(--error-color);
    border: 2px solid var(--error-color);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.1);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--error-color);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    border-left: 5px solid;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: var(--success-color);
    color: #155724;
}

.alert-error,
.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: var(--error-color);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: var(--info-color);
    color: #0c5460;
}

/* ========================================
   HEADER
   ======================================== */

.header {
    background: white;
    backdrop-filter: blur(10px);
    height: var(--header-height);
    box-shadow: 0 4px 16px rgba(43, 76, 126, 0.08), 0 0 0 1px rgba(43, 76, 126, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--secondary-color);
    transition: box-shadow 0.3s ease;
}

.header:hover {
    box-shadow: 0 6px 20px rgba(43, 76, 126, 0.12), 0 0 0 1px rgba(43, 76, 126, 0.08);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

.header-brand-text {
    display: flex;
    flex-direction: column;
}

.header-brand h1 {
    font-size: 1.35rem;
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.header-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
}

.header-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(43, 76, 126, 0.3);
    border: 2px solid white;
    transition: all 0.3s ease;
}

.header-user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(43, 76, 126, 0.4);
}

/* ========================================
   NAVIGATION
   ======================================== */

.navigation {
    width: var(--nav-width);
    background: white;
    border-right: 1px solid rgba(43, 76, 126, 0.1);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 90;
    box-shadow: 4px 0 16px rgba(43, 76, 126, 0.06);
}

.navigation::-webkit-scrollbar {
    width: 6px;
}

.navigation::-webkit-scrollbar-track {
    background: transparent;
}

.navigation::-webkit-scrollbar-thumb {
    background: rgba(43, 76, 126, 0.2);
    border-radius: 3px;
}

.navigation::-webkit-scrollbar-thumb:hover {
    background: rgba(43, 76, 126, 0.3);
}

.nav-menu {
    list-style: none;
    padding: var(--spacing-md) 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-xl);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-link:hover {
    background: linear-gradient(90deg, rgba(43, 76, 126, 0.08) 0%, transparent 100%);
    border-left-color: var(--secondary-color);
    color: var(--primary-color);
    padding-left: calc(var(--spacing-xl) + 4px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(43, 76, 126, 0.12) 0%, rgba(43, 76, 126, 0.03) 100%);
    border-left-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-icon {
    margin-right: var(--spacing-md);
    width: 24px;
    text-align: center;
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.nav-link:hover .nav-icon {
    transform: scale(1.15);
}

.nav-section {
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-sm) var(--spacing-xl);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin-top: var(--spacing-md);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    margin-left: var(--nav-width);
    padding: var(--spacing-xl);
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

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

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--secondary-color) 0%, transparent 100%) 1;
    position: relative;
}

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

.content-header h1 {
    font-size: 2.25rem;
    color: var(--primary-color);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    letter-spacing: -0.5px;
    position: relative;
}

.content-header .actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 2px 8px rgba(43, 76, 126, 0.06), 0 0 0 1px rgba(43, 76, 126, 0.04);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(43, 76, 126, 0.12), 0 0 0 1px rgba(43, 76, 126, 0.08);
    transform: translateY(-4px);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 2px solid rgba(43, 76, 126, 0.1);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-body.text-center {
    text-align: center;
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    background: #f9f9f9;
}

/* ========================================
   TABLES
   ======================================== */

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: auto;
}

table thead {
    background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
    border-bottom: 2px solid rgba(43, 76, 126, 0.15);
}

table th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
}

table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(43, 76, 126, 0.08);
    transition: background 0.2s ease;
    vertical-align: middle;
}

table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background: rgba(43, 76, 126, 0.03);
    box-shadow: 0 2px 4px rgba(43, 76, 126, 0.05);
}

/* Spezifische Spaltenbreiten für bessere Kontrolle */
table td:last-child,
table th:last-child {
    white-space: nowrap;
}

/* Text alignment helpers */
table .text-right {
    text-align: right;
}

table .text-center {
    text-align: center;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: linear-gradient(180deg, white 0%, #fafbfc 100%);
    border-top: 1px solid rgba(43, 76, 126, 0.1);
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-left: var(--nav-width);
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(43, 76, 126, 0.05);
}

.footer.no-nav {
    margin-left: 0;
}

/* ========================================
   DASHBOARD
   ======================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.stat {
    text-align: center;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(43, 76, 126, 0.03) 0%, transparent 100%);
    border-radius: var(--border-radius-lg);
    transition: all 0.3s ease;
}

.stat:hover {
    background: linear-gradient(135deg, rgba(43, 76, 126, 0.06) 0%, rgba(230, 57, 70, 0.03) 100%);
    transform: scale(1.02);
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(43, 76, 126, 0.1);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   BADGES
   ======================================== */

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20883a 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #333;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   GRID SYSTEM
   ======================================== */

.row {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.col-md-3 {
    flex: 0 0 calc(25% - var(--spacing-lg));
}

.col-md-4 {
    flex: 0 0 calc(33.333% - var(--spacing-lg));
}

.col-md-6 {
    flex: 0 0 calc(50% - var(--spacing-lg));
}

.col-md-8 {
    flex: 0 0 calc(66.666% - var(--spacing-lg));
}

.col-md-12 {
    flex: 0 0 100%;
}

@media (max-width: 768px) {
    .col-md-3, .col-md-4, .col-md-6, .col-md-8 {
        flex: 0 0 100%;
    }
}

/* ========================================
   DETAIL TABLES
   ======================================== */

.table-details {
    width: 100%;
}

.table-details th {
    width: 200px;
    padding: var(--spacing-sm) 0;
    font-weight: 600;
    vertical-align: top;
}

.table-details td {
    padding: var(--spacing-sm) 0;
}

/* ========================================
   STAT ITEMS
   ======================================== */

.stat-item {
    padding: var(--spacing-md);
    background: #f9f9f9;
    border-radius: var(--border-radius);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* ========================================
   FORM ACTIONS
   ======================================== */

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--secondary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--error-color);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    :root {
        --nav-width: 0;
    }

    .navigation {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .navigation.active {
        transform: translateX(0);
    }

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

    .footer {
        margin-left: 0;
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .login-container {
        padding: var(--spacing-sm);
    }

    .form-row {
        flex-direction: column;
    }
}

/* ========================================
   ENHANCED ANIMATIONS & MICRO-INTERACTIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.4s ease-out;
}

.table-responsive {
    animation: fadeIn 0.5s ease-out;
}

/* Smooth page transitions */
.main-content > * {
    animation: fadeIn 0.3s ease-out;
}

/* Loading state for buttons */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hover effect for action buttons in tables */
.table-responsive {
    position: relative;
}

table tbody tr {
    position: relative;
}

table tbody tr::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--secondary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

table tbody tr:hover::after {
    opacity: 1;
}

/* Improved focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Stat item animations */
.stat-item {
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(43, 76, 126, 0.1), transparent);
    transition: left 0.5s;
}

.stat-item:hover::before {
    left: 100%;
}

/* Enhanced badge hover */
.badge {
    transition: all 0.2s ease;
    cursor: default;
}

.badge:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Content header animation */
.content-header {
    animation: slideInFromLeft 0.5s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Form validation states */
.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.form-group input.is-valid,
.form-group select.is-valid,
.form-group textarea.is-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

/* Improve error messages */
.error,
.form-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Enhanced scrollbar for main content */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(43, 76, 126, 0.2);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(43, 76, 126, 0.3);
}

/* Tooltip-like effect for abbreviations */
abbr[title] {
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    cursor: help;
}

/* Print styles */
@media print {
    .header,
    .navigation,
    .footer,
    .btn,
    .alert {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1a3460;
        --border-color: #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   TABLE FIXES & IMPROVEMENTS
   ======================================== */

/* Ensure table columns align properly */
.table-responsive table {
    min-width: 100%;
}

/* Better button spacing in table cells */
table td .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

table td .btn:last-child {
    margin-right: 0;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-md);
    border-top: 1px solid rgba(43, 76, 126, 0.1);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-links {
    display: flex;
    gap: var(--spacing-xs);
}

/* Form control in tables */
.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e1e4e8;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(43, 76, 126, 0.1), 0 2px 8px rgba(43, 76, 126, 0.15);
}

/* Dropdown */
.dropdown, .btn-group {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: ' \25BE';
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 220px;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(43, 76, 126, 0.15);
    border: 1px solid rgba(43, 76, 126, 0.1);
    padding: var(--spacing-sm) 0;
    margin-top: 2px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(43, 76, 126, 0.08) 0%, transparent 100%);
    color: var(--primary-color);
    padding-left: 20px;
}

/* Badge in table cells - ensure they don't break layout */
table .badge {
    display: inline-block;
    white-space: nowrap;
}

/* Links in table cells */
table a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

table a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Small text in table cells */
table small {
    display: block;
    line-height: 1.4;
}

/* Responsive table improvements */
@media (max-width: 1024px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 800px;
    }
}

