/* 
 * =========================================
 * 1. ZMIENNE (Variables)
 * =========================================
 * Paleta Brązów (Custom)
 */
:root {
    /* Primary Color (Browns) */
    --primary-color: #5d4e46;
    --primary-color-rgb: 93, 78, 70;
    --primary-hover: #7d6a5f;
    --primary-light: #ece8e6;
    /* Jasne tło dla akcentów */

    /* Neutrals (Slate) */
    --text-main: #1E293B;
    /* Slate 800 */
    --text-muted: #64748B;
    /* Slate 500 */
    --border-color: #E2E8F0;
    /* Slate 200 */
    --bg-body: #f5f7fb;
    /* Light gray */
    --bg-surface: #FFFFFF;
    /* White */

    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --danger-color-rgb: 239, 68, 68;
    --info: #3B82F6;

    /* Spacing & Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);

    /* Animations */
    --transition-speed: 0.3s;
}

/* =========================================
 * 2. RESET & BASE
 * =========================================
 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all var(--transition-speed) ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
    opacity: 0;
    /* Default hidden state for JS loading */
    transition: opacity 0.4s ease-in-out;
}

body.js-loaded {
    opacity: 1;
}

/* =========================================
 * 3. LAYOUT STRUCTURE
 * =========================================
 */
.app-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    border-right: 1px solid var(--primary-hover);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform var(--transition-speed) ease;
    z-index: 50;
    color: white;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Wyśrodkowanie logo */
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 4px;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

.sidebar-nav {
    padding: 1.25rem 1.25rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.25rem;
    cursor: pointer;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.sidebar-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.02em;
}

.nav-chevron {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.sidebar-section:not(.open) .nav-chevron {
    transform: rotate(-90deg);
}

.nav-links li {
    margin-bottom: 0.35rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links li.active a {
    background: var(--primary-hover);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #c6ab9c;
}

.nav-links a i {
    width: 18px;
    height: 18px;
}

.sidebar-section:not(.open) .nav-links {
    display: none;
}

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

.logout-link {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.logout-link:hover {
    color: white;
}

.logout-link i {
    margin-right: 0.75rem;
    width: 20px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--transition-speed) ease;
}

/* Top Bar */
.top-bar {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-bar-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.top-bar-left h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.top-bar-center {
    display: flex;
    justify-content: center;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

.flag-pl {
    width: 28px;
    height: 20px;
    border-radius: 6px;
    display: inline-block;
    background: linear-gradient(#ffffff 50%, #d90429 50%);
    box-shadow: 0 0 0 1px #e5e7eb;
}

.flag-en {
    width: 28px;
    height: 20px;
    border-radius: 6px;
    display: inline-block;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'><rect width='28' height='20' fill='%23012169'/><path d='M0 0 L28 20 M28 0 L0 20' stroke='%23ffffff' stroke-width='6'/><path d='M0 0 L28 20 M28 0 L0 20' stroke='%23c8102e' stroke-width='3'/><path d='M14 0 V20 M0 10 H28' stroke='%23ffffff' stroke-width='6'/><path d='M14 0 V20 M0 10 H28' stroke='%23c8102e' stroke-width='3'/></svg>") center / cover no-repeat;
    box-shadow: 0 0 0 1px #e5e7eb;
}
.user-name {
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--text-muted);
    padding: 4px;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.btn-icon:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    /* In case it's a link */
    color: inherit;
}

.user-flag {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.user-flag:hover {
    opacity: 0.8;
}

.user-profile:hover {
    opacity: 0.8;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.user-profile span {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    list-style: none;
    padding: 0.5rem;
    display: none;
    z-index: 60;
}

.user-dropdown li {
    margin: 0;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
}

.user-dropdown a:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.user-dropdown i {
    width: 16px;
    height: 16px;
}

.user-menu.is-open .user-dropdown {
    display: block;
}

/* Content Wrapper */
.content-wrapper {
    padding: 2rem;
    width: 100%;
    animation: enter-fade 0.5s ease-out;
}

@keyframes enter-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.breadcrumb {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.breadcrumb-list li + li::before {
    content: "/";
    margin: 0 0.35rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

/* =========================================
 * 4. COMPONENTS
 * =========================================
 */

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(93, 78, 70, 0.1);
    text-decoration: none;
    /* For A tags */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.2);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--bg-body);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
    text-decoration: none;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--danger-color-rgb), 0.2);
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.alert.hidden {
    opacity: 0;
    pointer-events: none;
}

.alert::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.alert.success {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.4);
}

.alert.success::before {
    background: var(--success);
}

.alert.error {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.4);
}

.alert.error::before {
    background: var(--danger);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.alert-close:hover {
    opacity: 0.7;
}

.topbar-alert {
    margin-bottom: 0;
    width: 100%;
    max-width: 360px;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
}


/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.rep-add-header {
    margin-top: 2.25rem;
    margin-bottom: 0;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}


.home-grid {
    display: grid;
    gap: 1.5rem;
}

.home-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.home-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--primary-light);
    box-shadow: 0 10px 20px rgba(93, 78, 70, 0.2);
}

.home-card span {
    font-size: 1.05rem;
    font-weight: 700;
}

.home-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stat-card {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
    border-radius: var(--radius);
    padding: 1.5rem;
    color: white;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(93, 78, 70, 0.3);
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Icon Background Colors */
.bg-indigo {
    background: rgba(93, 78, 70, 0.1);
    color: var(--primary-color);
}

.bg-emerald {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.bg-amber {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.bg-rose {
    background: rgba(225, 29, 72, 0.1);
    color: var(--danger);
}

.bg-blue {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-info .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

.stat-trend {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 2px;
}

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

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

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

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-placeholder {
    height: 200px;
    background: var(--bg-body);
    border-radius: var(--radius);
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 10px;
    overflow: hidden;
    position: relative;
    border: 1px dashed var(--border-color);
    /* Visual clue it's a placeholder */
}

.chart-placeholder .bar {
    width: 10%;
    background: var(--primary-color);
    border-radius: 4px 4px 0 0;
    opacity: 0.8;
}

.line-chart svg {
    width: 100%;
    height: 100%;
}

/* Table */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-card .card-header {
    padding: 1.5rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
}

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

tr:nth-child(even) {
    background-color: var(--primary-light);
}

tr:hover td {
    background-color: rgba(93, 78, 70, 0.1);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-md {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-right: 1rem;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-completed {
    background: #D1FAE5;
    color: #065F46;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.action-icon {
    color: var(--text-muted);
    cursor: pointer;
}

.link-primary {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.link-primary:hover {
    text-decoration: underline;
}

.btn-icon-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.btn-icon-sm:hover {
    color: var(--primary-color);
}

/* List Actions */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-action {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    /* In case A link */
}

.btn-icon-action:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-icon-action i {
    width: 16px;
    height: 16px;
}

/* Page Tabs (Zakładki) */
.page-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-link {
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

.tab-link:hover {
    color: var(--primary-color);
    background: rgba(93, 78, 70, 0.05);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(93, 78, 70, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    max-width: 520px;
}

.form-columns .form-group {
    margin-bottom: 0.5rem;
}

.rep-table {
    width: 100%;
    border-collapse: collapse;
}

.rep-table td,
.rep-table th {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
/* Custom classes for inline styles */
.icon-label-inline {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.rep-table-actions-cell {
    width: 80px;
    text-align: center;
}

.form-actions-bottom {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-actions-bottom.form-actions-save {
    justify-content: flex-end;
}

.form-actions-bottom.form-actions-save.form-actions-save-left {
    justify-content: flex-start;
}

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

.rep-add-form {
    width: 50%;
}

.rep-add-form .form-actions-bottom {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 1.5rem;
    gap: 0.5rem;
}

.rep-add-form .btn-primary {
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
    height: 42px;
    width: auto;
}

.rep-add-form .form-control {
    height: 42px;
}

@media (max-width: 900px) {
    .rep-add-form {
        width: 100%;
    }
}

.card-highlighted-section {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg-body);
    border-radius: var(--radius);
}

.card-highlighted-section-title {
    margin-bottom: 1rem;
}
/* Form Styles */
.grid-layout-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-static-lines {
    margin-bottom: 1.5rem;
    display: grid;
    gap: 0.4rem;
}

.form-static-line {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    color: var(--text-main);
}

.form-static-label {
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-main);
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 78, 70, 0.1);
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
    cursor: pointer;
    background: white;
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.date-input-wrapper {
    position: relative;
}

.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.calendar-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-radio,
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.custom-radio input,
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    /* Fix: make ensuring clicking works */
    width: 0;
    height: 0;
}

.radio-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s;
    display: inline-block;
}

.custom-radio input:checked~.radio-mark {
    border-color: var(--primary-color);
}

.custom-radio input:checked~.radio-mark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox input:checked~.checkbox-mark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.checkbox-mark i {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.custom-checkbox input:checked~.checkbox-mark i {
    opacity: 1;
    transform: scale(1);
}

/* Upload Dropzone */
.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-body);
}

.file-dropzone:hover {
    border-color: var(--primary-color);
    background: rgba(93, 78, 70, 0.05);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.dropzone-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Auth Pages */
.page-login {
    background: var(--primary-light);
}

.auth-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 2rem;
    padding-top: 8vh;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
}

.auth-logo {
    display: block;
    width: 72px;
    height: auto;
    margin: 0 auto 1rem;
    border-radius: 8px;
}

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-footer {
    margin-top: 1rem;
    text-align: center;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Responsive adjustment for Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .filter-popup {
        width: 100%;
        left: 0;
        right: 0;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-popup .form-group {
        display: block;
    }

    .grid-layout-details {
        grid-template-columns: 1fr;
    }

    .top-bar {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .top-bar-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Visibility Helpers */
.mobile-only {
    display: none !important;
}

.logo-img-sm {
    height: 32px;
    width: auto;
}

.mobile-logo-group {
    display: none;
    align-items: center;
    gap: 1rem;
    margin-right: auto;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }

    .mobile-logo-group {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* Sekcje na stronie głównej */
.page-section {
    margin-bottom: 3rem; /* Odstęp między sekcjami */
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

/* Poprawka siatki dla 3 kolumn */
@media (min-width: 768px) {
    .home-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================
 * 5. MODERN LIST VIEW (dla firmy-lista.html)
 * =========================================
 */

/* Nagłówek listy */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.list-header .header-left .breadcrumb {
    margin-bottom: 0.5rem;
}

.list-header .header-left h1 {
    margin: 0;
}

.list-header .header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-width: 300px;
    transition: all var(--transition-speed) ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

/* Filter popover */
.filter-container {
    position: relative;
}

.filter-popup {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 720px;
    max-width: 90vw;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    display: none;
    z-index: 30;
}

.filter-popup.is-open {
    display: block;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
}

.filter-popup .form-group {
    display: block;
}

.filter-popup .form-group label {
    margin-bottom: 0.35rem;
}

.filter-popup .select-wrapper {
    width: 100%;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* Statystyki nad listą */
.stats-grid.modern-stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-modern {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.stat-card-modern .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card-modern .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Kontener na karty */
.list-container.modern-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Nowoczesna karta */
.modern-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed) ease;
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card-main-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.card-avatar-initials {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
}

.card-title-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.card-title-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.25rem 0 0.75rem;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
}

.card-tags span {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-role-partner { background: rgba(var(--primary-color-rgb), 0.1); color: var(--primary-color); }
.tag-role-guest { background: #E2E8F0; color: #475569; }
.tag-status-active { background: #D1FAE5; color: #065F46; }
.tag-status-inactive { background: #FEE2E2; color: #991B1B; }

.card-actions {
    display: flex;
    gap: 0.5rem;
}



