/**
 * Astrolus-Inspired Design System for LTS Urlaubsportal
 * Modern SaaS Dashboard Style with Tailwind-like utilities
 */

/* =========================
   CSS VARIABLES - COLOR PALETTE
   ========================= */
:root {
    /* Primary Colors - LTS Red/Black Theme */
    --primary-600: #dc2626;
    --primary-700: #b91c1c;
    --primary-800: #991b1b;
    --primary-900: #7f1d1d;

    /* Accent Colors - LTS Theme */
    --accent-red: #ef4444;
    --accent-dark: #1f2937;
    --accent-black: #111827;

    /* Neutral Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Dark Sidebar Colors */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #334155;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Gradients - LTS Red/Black Theme */
    --gradient-primary: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    --gradient-red: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Spacing System */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================
   BASE STYLES
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================
   LAYOUT - SIDEBAR + MAIN
   ========================= */
.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

/* Sidebar */
.app-sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-logo-img {
    height: 40px;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
}

.sidebar-nav-section {
    margin-bottom: var(--space-xl);
}

.sidebar-nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: var(--space-md);
    padding: 0 var(--space-md);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-md);
    color: var(--gray-300);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.sidebar-nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
    transform: translateX(2px);
}

.sidebar-nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.sidebar-nav-item i {
    width: 20px;
    font-size: 18px;
    opacity: 0.8;
}

.sidebar-nav-item.active i {
    opacity: 1;
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    color: white;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--gray-400);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navbar */
.app-navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 var(--space-xl);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.navbar-search {
    position: relative;
    width: 400px;
}

.navbar-search input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 2.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 14px;
    transition: all var(--transition-base);
    background: var(--gray-50);
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--primary-600);
    background: white;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.navbar-search i {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.navbar-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--gray-600);
    transition: all var(--transition-base);
    position: relative;
}

.navbar-action:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.navbar-action-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border: 2px solid white;
    border-radius: var(--radius-full);
}

/* Navbar link with text */
.navbar-link {
    width: auto;
    padding: 0 var(--space-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.navbar-link i {
    font-size: 16px;
}

/* Content Area */
.app-content {
    flex: 1;
    padding: var(--space-2xl);
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-2xl);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.page-subtitle {
    font-size: 15px;
    color: var(--gray-600);
    font-weight: 400;
}

.page-header-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* =========================
   CARDS
   ========================= */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-body {
    padding: var(--space-xl);
}

.card-body-compact {
    padding: 0;
}

.card-footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card.stat-primary::before {
    background: var(--gradient-red);
}

.stat-card.stat-success::before {
    background: var(--gradient-success);
}

.stat-card.stat-warning::before {
    background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
}

.stat-card.stat-danger::before {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-top: var(--space-md);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-icon {
    position: absolute;
    right: var(--space-lg);
    bottom: var(--space-lg);
    font-size: 40px;
    opacity: 0.1;
    color: var(--gray-900);
}

/* =========================
   BUTTONS
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-700);
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 16px;
}

/* =========================
   FORMS
   ========================= */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-900);
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

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

.form-help {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: var(--space-xs);
}

/* =========================
   TABLES
   ========================= */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================
   BADGES
   ========================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.625rem;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-700);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* =========================
   ALERTS
   ========================= */
.alert {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: #065f46;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: #1e40af;
}

.alert i {
    font-size: 20px;
}

/* =========================
   UTILITIES
   ========================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-600); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

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

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

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }
.gap-4 { gap: var(--space-lg); }

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--space-md) * -1);
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 var(--space-md); }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 var(--space-md); }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding: 0 var(--space-md); }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 var(--space-md); }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; padding: 0 var(--space-md); }

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

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

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

    .navbar-search {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .app-content {
        padding: var(--space-lg);
    }

    .navbar-search {
        display: none;
    }

    .page-title {
        font-size: 22px;
    }

    .stat-number {
        font-size: 24px;
    }

    /* Lepsze ikony w menu na mobile */
    .sidebar-nav-item i {
        font-size: 20px;
        width: 24px;
        margin-right: 4px;
    }

    .sidebar-nav-item {
        padding: 14px 18px;
        font-size: 15px;
    }

    .sidebar-nav-title {
        font-size: 11px;
        padding: 12px 18px 8px;
    }

    /* Większe przyciski touch-friendly */
    .navbar-action {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Badge dla notyfikacji bardziej widoczny */
    .badge.badge-warning {
        font-size: 11px;
        min-width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

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

.fade-in {
    animation: fadeIn var(--transition-base);
}

/* =========================
   SIGNATURE PAD
   ========================= */
.signature-wrapper {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    background: var(--gray-50);
}

.signature-pad {
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    cursor: crosshair;
}

/* =========================
   MODALS
   ========================= */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
}

.modal-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    padding: var(--space-xl);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
