/* Sidebar layout and app shell styles */

:root {
    /* Cinematic Sidebar Palette */
    --sidebar-bg: linear-gradient(180deg, rgba(11, 27, 58, 0.95) 0%, rgba(5, 11, 20, 0.98) 100%);
    --sidebar-bg-solid: #0a1628;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(56, 189, 248, 0.1);
    --sidebar-border: rgba(56, 189, 248, 0.15);
    --accent-cyan: #38bdf8;
    --accent-glow: #0ea5e9;
    
    /* Main content */
    --main-bg: #f9fafb;
    --content-bg: #ffffff;
    --border-color: #e5e7eb;
    --primary-color: #3b82f6;
    --primary-hover-color: #2563eb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
}

/* Reset & global */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { background-color: var(--main-bg); color: var(--text-dark); display: flex; flex-direction: column; min-height: 100vh; }

/* App layout */
.app-layout { display: flex; min-height: 100vh; flex: 1 0 auto; }

/* Sidebar - Cinematic Style */
.sidebar { 
    width: 260px; 
    background: var(--sidebar-bg);
    background-color: var(--sidebar-bg-solid);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--sidebar-border);
    color: var(--sidebar-text); 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    transition: width 0.3s ease;
    position: relative;
}

/* Sidebar Header - vertical layout with toggle below */
.sidebar-header { 
    padding: 20px 16px; 
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    border-bottom: 1px solid var(--sidebar-border); 
}

/* Sidebar Brand Link - cinematic style */
.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}
.sidebar-brand-link:hover {
    transform: scale(1.02);
}

/* Brand Icon with animated rhombus - matching landing */
.sidebar-brand-icon {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-icon-bg {
    position: absolute;
    inset: 0;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transform: rotate(45deg);
    transition: transform 0.5s;
}
.sidebar-brand-link:hover .sidebar-icon-bg {
    transform: rotate(0deg);
}
.sidebar-brand-icon i {
    position: relative;
    z-index: 10;
    color: var(--accent-cyan);
    font-size: 0.875rem;
}

/* Brand Text */
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.sidebar-brand-text .brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.sidebar-brand-text .brand-name .accent {
    color: var(--accent-cyan);
}
.sidebar-brand-text .brand-subtitle {
    font-size: 9px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 3px;
}

/* Toggle button - below logo, full width */
.sidebar-toggle {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}
.sidebar-toggle:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.sidebar-toggle i {
    transition: transform 0.3s;
}
.sidebar-toggle::after {
    content: 'Zwiń panel';
    font-size: 11px;
}

/* Sidebar Nav - Cinematic Style */
.sidebar-nav { 
    flex-grow: 1; 
    padding: 16px 0; 
    list-style: none; 
    margin: 0; 
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-nav a { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 20px; 
    color: var(--sidebar-text); 
    text-decoration: none; 
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease; 
    border-left: 3px solid transparent;
    white-space: nowrap;
    position: relative;
}
.sidebar-nav a:hover { 
    color: #fff;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.1) 0%, transparent 100%);
}
.sidebar-nav a.active { 
    color: var(--accent-cyan);
    border-left-color: var(--accent-cyan);
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, transparent 100%);
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}
.sidebar-nav .bi { font-size: 1rem; width: 24px; flex-shrink: 0; text-align: center; }
.sidebar-nav span { transition: opacity 0.2s, width 0.2s; }
.nav-separator { 
    font-size: 11px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    padding: 24px 20px 10px 20px; 
    color: #475569; 
    white-space: nowrap;
    overflow: hidden;
    font-weight: 700;
}

/* Sidebar Footer / Copyright */
.sidebar-footer { 
    padding: 16px 20px; 
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
}
.sidebar-copyright {
    font-size: 0.7rem;
    color: #6b7280;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

/* ========== COLLAPSED STATE ========== */
.sidebar.collapsed {
    width: 72px;
}
.sidebar.collapsed .sidebar-header {
    padding: 12px;
    align-items: center;
}
.sidebar.collapsed .sidebar-brand-text {
    display: none;
}
.sidebar.collapsed .sidebar-brand-link {
    justify-content: center;
}
/* Toggle button stays below logo, just smaller */
.sidebar.collapsed .sidebar-toggle {
    padding: 8px;
    width: 100%;
}
.sidebar.collapsed .sidebar-toggle::after {
    display: none; /* Hide "Zwiń panel" text */
}
.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}
.sidebar.collapsed .sidebar-nav a {
    padding: 12px;
    justify-content: center;
}
.sidebar.collapsed .sidebar-nav a span {
    display: none;
}
.sidebar.collapsed .nav-separator {
    text-align: center;
    padding: 16px 8px 8px 8px;
    font-size: 0.5rem;
    letter-spacing: 0;
}
.sidebar.collapsed .sidebar-footer {
    padding: 12px 8px;
}
.sidebar.collapsed .sidebar-copyright span {
    display: none;
}
.sidebar.collapsed .sidebar-copyright::before {
    content: '©';
}

/* Main content */
.main-content { flex-grow: 1; padding: 32px; background-color: var(--main-bg); }
.app-layout.has-sidebar .main-content { overflow-y: auto; }
.app-layout.public { flex-direction: column; }
.app-layout.public .main-content { overflow: visible; padding: 0; background-color: transparent; flex: 1 0 auto; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.content-header h1 { font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-size: 2rem; margin: 0; }
.breadcrumbs { margin-bottom: 8px; font-size: .875rem; color: var(--text-light); }
.breadcrumbs a { color: var(--primary-color); text-decoration: none; }

.btn { display: inline-block; padding: 10px 20px; font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-size: .9rem; font-weight: 600; text-align: center; border-radius: 6px; border: 1px solid transparent; cursor: pointer; transition: all .3s ease; text-decoration: none; }
.btn-primary { background-color: #5ea0ff; color: #fff; border-color: #5ea0ff; }
.btn-primary:hover { background-color: #7ab2ff; border-color: #7ab2ff; }

.content-body { background-color: var(--content-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.content-body-header { padding: 16px 24px; border-bottom: 1px solid var(--border-color); }
.content-body-header h2 { font-size: 1.125rem; margin: 0; font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
.table-container { padding: 24px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
th { font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-weight: 600; color: var(--text-light); text-transform: uppercase; font-size: .75rem; }
tbody tr:last-child td { border-bottom: none; }

/* Badges */
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.status-active { background-color: #dcfce7; color: #166534; }
.status-archived { background-color: #f3f4f6; color: #4b5563; }

/* Topbar - pełny pasek na górze */
.app-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

/* Topbar Button (język) */
.topbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px;
    color: #374151 !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none !important;
    transition: all 0.2s;
}
.topbar-btn:hover {
    border-color: #3b82f6 !important;
    background: #f8fafc;
}
.topbar-btn .bi-globe2 {
    color: #3b82f6;
    font-size: 1rem;
}
.topbar-btn::after { display: none; }

/* Topbar Avatar (konto) */
.topbar-avatar {
    padding: 0;
    border: none !important;
    background: transparent !important;
}
.topbar-avatar::after { display: none; }
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.topbar-avatar:hover .avatar-circle {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}

/* Topbar Dropdown Menu */
.topbar-dropdown {
    min-width: 160px;
    padding: 6px 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.topbar-dropdown .dropdown-header {
    padding: 10px 14px;
    font-size: 0.85rem;
}
.topbar-dropdown .dropdown-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-dropdown .dropdown-item i {
    font-size: 0.95rem;
    opacity: 0.7;
}
.topbar-dropdown .dropdown-item.active {
    background: #eff6ff;
    color: #3b82f6;
}
.topbar-dropdown .dropdown-divider {
    margin: 4px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { position: absolute; left: -260px; z-index: 1001; }
  .sidebar.open { left: 0; }
  .main-content { padding: 16px; }
  .content-header { flex-direction: column; align-items: flex-start; gap: 16px; }
}


