/* ============================================
   Ineris Panel Klienta - Style CSS
   Kolory: żółto-pomarańczowe, jasny motyw
   Wzorowane na IAS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Kolory główne */
    --primary-50: #fffbeb;
    --primary-100: #fef3c7;
    --primary-200: #fde68a;
    --primary-300: #fcd34d;
    --primary-400: #fbbf24;
    --primary-500: #f59e0b;
    --primary-600: #d97706;
    --primary-700: #b45309;
    --primary-800: #92400e;
    --primary-900: #78350f;
    
    /* Pomarańczowe akcenty */
    --accent-400: #fb923c;
    --accent-500: #f97316;
    --accent-600: #ea580c;
    
    /* Neutralne (Slate) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Semantyczne */
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    
    /* Tło i powierzchnie */
    --background: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    
    /* Cienie */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);
    
    /* Typografia */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Zaokrąglenia */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Przejścia */
    --transition: 200ms ease;
    --transition-fast: 150ms ease;
    
    /* Layout */
    --sidebar-width: 260px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--slate-800);
    background-color: var(--surface);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typografia */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--slate-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-700);
}

.mono {
    font-family: var(--font-mono);
}

.text-muted { color: var(--slate-500); }
.text-small { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* ============================================
   LAYOUT - Strona główna (przed logowaniem)
   ============================================ */

.landing-layout {
    display: flex;
    min-height: 100vh;
}

.landing-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-600) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.landing-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: float 30s linear infinite;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

.landing-left-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.landing-left .logo {
    width: 180px;
    margin-bottom: 40px;
    filter: brightness(0) invert(1);
}

.landing-left h1 {
    color: white;
    font-size: 2.75rem;
    margin-bottom: 20px;
}

.landing-left p {
    font-size: 1.125rem;
    opacity: 0.95;
    line-height: 1.7;
}

.landing-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    background: white;
}

.landing-box {
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.landing-box .logo-mobile {
    display: none;
    width: 140px;
    margin-bottom: 30px;
}

.landing-box h2 {
    margin-bottom: 12px;
}

.landing-box .subtitle {
    color: var(--slate-500);
    margin-bottom: 40px;
}

.landing-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.landing-features {
    list-style: none;
    margin-top: 50px;
    text-align: left;
}

.landing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: rgba(255,255,255,0.95);
    font-size: 1rem;
}

.landing-features li svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ============================================
   LAYOUT - Dashboard (po zalogowaniu)
   ============================================ */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
    width: 130px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-400);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--slate-600);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--slate-50);
    color: var(--primary-600);
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary-700);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-cid {
    font-size: 0.75rem;
    color: var(--slate-500);
    font-family: var(--font-mono);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.page-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--slate-500);
    font-size: 0.875rem;
}

.page-content {
    padding: 32px;
}

/* ============================================
   KOMPONENTY
   ============================================ */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-600) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    color: white;
}

.btn-secondary {
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--slate-200);
    color: var(--slate-800);
}

.btn-ghost {
    background: transparent;
    color: var(--slate-600);
    padding: 8px 12px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--slate-100);
    color: var(--slate-800);
}

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

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

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--slate-50);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--slate-100);
    background: var(--slate-50);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.stat-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.info {
    background: var(--info-bg);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--slate-900);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--slate-500);
    margin-top: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--slate-700);
    font-size: 0.875rem;
}

.form-label .required {
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--slate-800);
    background: white;
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.form-control::placeholder {
    color: var(--slate-400);
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--slate-500);
    margin-top: 6px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--slate-600);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    vertical-align: middle;
}

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

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-bg);
    color: #065f46;
}

.badge-danger {
    background: var(--error-bg);
    color: #991b1b;
}

.badge-warning {
    background: var(--warning-bg);
    color: #92400e;
}

.badge-info {
    background: var(--info-bg);
    color: #1e40af;
}

.badge-secondary {
    background: var(--slate-100);
    color: var(--slate-600);
}

.badge-purple {
    background: #ede9fe;
    color: #5b21b6;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: var(--error-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Data Box */
.data-box {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.data-box-label {
    font-size: 0.75rem;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.data-box-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-800);
    font-family: var(--font-mono);
    letter-spacing: 2px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--slate-400);
}

.empty-state-icon svg {
    width: 32px;
    height: 32px;
}

.empty-state-title {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--slate-500);
    margin-bottom: 20px;
}

/* Utilities */
.d-flex { display: flex; }
.d-grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .landing-layout {
        flex-direction: column;
    }
    
    .landing-left {
        padding: 40px 24px;
    }
    
    .landing-left h1 {
        font-size: 2rem;
    }
    
    .landing-right {
        padding: 40px 24px;
    }
    
    .landing-box .logo-mobile {
        display: block;
        margin: 0 auto 30px;
    }
    
    .landing-left .logo,
    .landing-features {
        display: none;
    }
    
    .page-header {
        padding: 20px;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--slate-600);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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