/* ============================================
   Ineris SMS - Style główne (v2)
   Paleta: granat/niebieski z akcentem złota
   ============================================ */

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

:root {
    --primary-50:  #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    --primary-950: #0b1f3a;

    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    --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;

    --success: #10b981; --success-bg: #d1fae5;
    --error: #ef4444;   --error-bg: #fee2e2;
    --warning: #f59e0b; --warning-bg: #fef3c7;
    --info: #3b82f6;    --info-bg: #dbeafe;

    --background: #f6f8fb;
    --surface: #ffffff;
    --border: #e2e8f0;

    --grad-primary: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    --grad-accent: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    --grad-mesh: radial-gradient(circle at 20% 20%, #1e3a8a 0%, transparent 50%),
                 radial-gradient(circle at 80% 80%, #2563eb 0%, transparent 50%),
                 radial-gradient(circle at 50% 50%, #0b1f3a 0%, transparent 70%);
    --grad-soft: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    --grad-card: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.95) 100%);

    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
    --shadow: 0 1px 3px 0 rgb(15 23 42 / 0.08), 0 1px 2px -1px rgb(15 23 42 / 0.06);
    --shadow-md: 0 4px 12px -2px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.04);
    --shadow-lg: 0 10px 25px -5px rgb(15 23 42 / 0.10), 0 8px 10px -6px rgb(15 23 42 / 0.05);
    --shadow-xl: 0 25px 50px -12px rgb(15 23 42 / 0.25);
    --shadow-glow: 0 0 30px rgb(37 99 235 / 0.25);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --transition: 200ms ease;
    --sidebar-width: 260px;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--slate-800);
    background: var(--background);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; color: var(--slate-900); }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
a { color: var(--primary-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-700); }
.text-muted { color: var(--slate-500); }
.text-small { font-size: 0.86rem; }
.text-xs { font-size: 0.75rem; }
code, .mono { font-family: var(--font-mono); }
hr { border: 0; border-top: 1px solid var(--border); }

/* =================================================
   GLOBALNY PRELOADER (full-screen, znika po load)
   ================================================= */
.app-preloader {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 20%, #1e3a8a 0%, #0b1f3a 60%, #050d1c 100%);
    transition: opacity 420ms ease, visibility 420ms;
}
.app-preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.app-preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.app-preloader-logo {
    width: 110px; height: 110px;
    filter: brightness(0) invert(1);
    animation: pulseLogo 2.2s ease-in-out infinite;
}
@keyframes pulseLogo {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.06); }
}
.app-preloader-spinner {
    width: 56px; height: 56px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--accent-400);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.app-preloader-text {
    color: rgba(255,255,255,0.7); font-size: 0.92rem; letter-spacing: 0.08em;
    text-transform: uppercase; font-weight: 600;
    animation: dotsAnim 1.4s steps(4, end) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dotsAnim {
    0%   { content: 'Ładowanie'; }
    25%  { content: 'Ładowanie.'; }
    50%  { content: 'Ładowanie..'; }
    75%  { content: 'Ładowanie...'; }
}

/* Inline spinner (na buttonach itp.) */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.45); border-top-color: white;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after {
    border-color: rgba(15,23,42,0.18); border-top-color: var(--slate-700);
}

/* Toast (pop-up powiadomienia) */
.toast-stack {
    position: fixed; top: 22px; right: 22px; z-index: 9000;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    min-width: 260px; max-width: 380px;
    display: flex; gap: 10px; align-items: flex-start;
    font-size: 0.9rem; color: var(--slate-700);
    animation: toastIn 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.is-out { animation: toastOut 240ms forwards; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-info    { border-left: 3px solid var(--primary-500); }
.toast-warn    { border-left: 3px solid var(--warning); }
.toast-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-info .toast-icon { color: var(--primary-600); }
.toast-warn .toast-icon { color: var(--warning); }
@keyframes toastIn  { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to   { transform: translateX(40px); opacity: 0; } }

/* =================================================
   LANDING (logowanie) - 2 kolumny
   ================================================= */
.landing-layout { display: flex; min-height: 100vh; overflow: hidden; }
.landing-left {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px;
    background: radial-gradient(circle at 20% 20%, var(--primary-700) 0%, var(--primary-900) 55%, var(--primary-950) 100%);
    color: white;
    position: relative; overflow: hidden;
}
.landing-left::before {
    content: ''; position: absolute; inset: -10%;
    background:
        radial-gradient(circle at 80% 10%, rgba(251,191,36,0.18), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(96,165,250,0.18), transparent 50%);
    pointer-events: none;
}
.landing-left::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 35%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 35%, transparent 75%);
}
.landing-left-content { position: relative; z-index: 1; max-width: 480px; }
.landing-left .logo { width: 180px; margin-bottom: 32px; filter: brightness(0) invert(1); }
.landing-left h1 { color: white; font-size: 2.5rem; margin-bottom: 18px; line-height: 1.1; }
.landing-left p { font-size: 1.05rem; opacity: 0.92; }
.landing-features { list-style: none; margin-top: 40px; }
.landing-features li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; color: rgba(255,255,255,0.92);
}
.landing-features svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent-400); }

.landing-right {
    flex: 0 0 500px; max-width: 500px;
    display: flex; align-items: center; justify-content: center;
    padding: 40px; background: var(--surface);
    position: relative; overflow: hidden;
}
.landing-right > .landing-box { position: relative; z-index: 2; }

/* =================================================
   SINGLE-COLUMN LANDING (license_*, account_setup itp.)
   ================================================= */
.landing-single {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 15% 10%, rgba(59,130,246,0.10), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(251,191,36,0.10), transparent 45%),
        linear-gradient(135deg, #f6f8fb 0%, #eff6ff 100%);
    position: relative; overflow: hidden;
}
.landing-single .landing-box {
    width: 100%; max-width: 460px;
    text-align: center;
    position: relative; z-index: 3;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 25px 60px -25px rgba(15,23,42,0.30);
    border: 1px solid rgba(255,255,255,0.7);
    animation: landingFadeIn 460ms ease-out;
}
.landing-single--wide  .landing-box { max-width: 680px; }
.landing-single--xwide .landing-box { max-width: 780px; }
.landing-box .logo-mobile { width: 96px; margin: 0 auto 18px; display: block; }
.landing-box h2 { font-size: 1.6rem; margin-bottom: 8px; }
.landing-box .subtitle { color: var(--slate-500); margin-bottom: 24px; }
.landing-buttons { margin: 26px 0 18px; display: grid; gap: 12px; }
.signup-hint { margin-top: 22px; color: var(--slate-500); font-size: 0.88rem; }

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

/* Dekoracyjne ozdoby tła - z-index bezpieczne */
.landing-deco-dots {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.35; z-index: 0;
    background-image: radial-gradient(var(--slate-300) 1px, transparent 1px);
    background-size: 28px 28px;
}
.landing-deco-blob {
    position: absolute; pointer-events: none; z-index: 0;
    width: 460px; height: 460px;
    right: -150px; top: 50%; transform: translateY(-50%);
    animation: blobFloat 14s ease-in-out infinite alternate;
}
.landing-deco-blob--accent {
    width: 320px; height: 320px;
    left: -110px; bottom: -110px; top: auto; right: auto; transform: none;
    animation: blobFloat2 16s ease-in-out infinite alternate-reverse;
}
@keyframes blobFloat {
    0%   { transform: translateY(-50%) rotate(0deg) scale(1); }
    100% { transform: translateY(-46%) rotate(14deg) scale(1.06); }
}
@keyframes blobFloat2 {
    0%   { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(-12deg) scale(1.08); }
}

/* =================================================
   BUTTONY
   ================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--radius);
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
    border: 1px solid transparent; cursor: pointer; transition: all var(--transition);
    text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white; box-shadow: 0 4px 12px -2px rgba(37,99,235,0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%); color: white; transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(37,99,235,0.45); }
.btn-secondary { background: var(--surface); color: var(--slate-700); border-color: var(--border); }
.btn-secondary:hover { background: var(--slate-50); border-color: var(--slate-300); color: var(--slate-800); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--slate-600); }
.btn-ghost:hover { background: var(--slate-100); color: var(--slate-800); }
.btn-accent { background: linear-gradient(135deg, var(--accent-400) 0%, var(--accent-600) 100%); color: white; box-shadow: 0 4px 12px -2px rgba(245,158,11,0.35); }
.btn-accent:hover { color: white; transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(245,158,11,0.45); }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-ghost.btn-danger { background: transparent; color: var(--error); }
.btn-ghost.btn-danger:hover { background: var(--error-bg); color: var(--error); }
.btn-lg { padding: 14px 22px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn.disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* =================================================
   FORMULARZE
   ================================================= */
.form-stack { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.form-group label, .field-label { font-size: 0.86rem; font-weight: 600; color: var(--slate-700); }
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--slate-800);
    font-family: var(--font-body); font-size: 0.95rem; transition: all var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgb(59 130 246 / 0.12); }
.form-control-sm { padding: 6px 10px; font-size: 0.82rem; }
.color-input { padding: 4px; height: 38px; cursor: pointer; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* =================================================
   ALERTY
   ================================================= */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 0.92rem; }
.alert-error { background: var(--error-bg); color: #991b1b; }
.alert-error svg { color: var(--error); }
.alert-success { background: var(--success-bg); color: #065f46; }
.alert-success svg { color: var(--success); }
.alert-info { background: var(--info-bg); color: #1e3a8a; }
.alert-warning { background: var(--warning-bg); color: #78350f; }

/* =================================================
   DASHBOARD LAYOUT
   ================================================= */
.dashboard-layout { display: flex; min-height: 100vh; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 40; backdrop-filter: blur(2px); }
.sidebar {
    width: var(--sidebar-width); background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 50;
}
.sidebar-header { padding: 22px 22px 16px; border-bottom: 1px solid var(--border); }
.sidebar-header .logo { height: 38px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 14px; }
.nav-section { margin-bottom: 18px; }
.nav-section-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-400); padding: 6px 10px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--slate-600); font-weight: 500; font-size: 0.9rem;
    transition: all var(--transition);
    position: relative;
}
.nav-item:hover { background: var(--slate-50); color: var(--slate-900); }
.nav-item.active {
    background: linear-gradient(135deg, var(--primary-50) 0%, rgba(219,234,254,0.5) 100%);
    color: var(--primary-700);
}
.nav-item.active::before {
    content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
    background: var(--primary-600); border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.88rem; color: var(--slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.74rem; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-content { flex: 1; min-width: 0; }
.page-container { padding: 28px 36px; animation: pageFadeIn 320ms ease-out; }
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-header { display: none; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); align-items: center; gap: 14px; }
.mobile-menu-btn { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--slate-700); }
.mobile-menu-btn svg { width: 24px; height: 24px; }
.mobile-logo { height: 28px; }

.trial-banner { background: linear-gradient(135deg, var(--accent-400), var(--accent-600)); color: white; padding: 10px 20px; display: flex; align-items: center; justify-content: center; gap: 14px; font-weight: 600; flex-wrap: wrap; }
.trial-banner svg { color: white; }
.trial-days { background: rgba(255,255,255,0.25); padding: 4px 12px; border-radius: 20px; font-size: 0.86rem; }

/* =================================================
   PAGE HEADER
   ================================================= */
.page-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { font-size: 1.65rem; margin-bottom: 4px; }
.page-subtitle { color: var(--slate-500); font-size: 0.95rem; }

/* =================================================
   KARTY
   ================================================= */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 1.05rem; }
.card-body { padding: 20px; }

.range-tabs { display: flex; gap: 6px; }

.voice-picker { display: flex; gap: 10px; align-items: stretch; }
.voice-picker select { flex: 1; }
.voice-test-status { margin-top: 10px; font-size: 0.86rem; color: var(--slate-500); min-height: 22px; }
.voice-test-status.playing { color: var(--primary-700); font-weight: 600; }
.voice-test-status.error { color: var(--error); }

.stats-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 18px; display: flex; align-items: center; gap: 14px;
    transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.primary { background: var(--primary-50); color: var(--primary-600); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-value { font-size: 1.4rem; font-weight: 800; font-family: var(--font-heading); color: var(--slate-900); }
.stat-label { color: var(--slate-500); font-size: 0.85rem; }

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2col { grid-template-columns: 1fr; } }

/* =================================================
   TABELE
   ================================================= */
.table { width: 100%; border-collapse: collapse; }
.table thead th { background: var(--slate-50); font-weight: 600; text-align: left; padding: 11px 16px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-500); border-bottom: 1px solid var(--border); }
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--slate-50); }
.row-primary { font-weight: 600; color: var(--slate-800); }
.actions-cell { display: flex; gap: 6px; align-items: center; }

/* =================================================
   BADGE
   ================================================= */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.74rem; font-weight: 600; }
.badge-success { background: var(--success-bg); color: #065f46; }
.badge-danger { background: var(--error-bg); color: #991b1b; }
.badge-warning { background: var(--warning-bg); color: #78350f; }
.badge-info { background: var(--info-bg); color: #1e3a8a; }
.badge-secondary { background: var(--slate-100); color: var(--slate-700); }

.inline-code { background: var(--slate-100); padding: 2px 8px; border-radius: 5px; font-size: 0.84rem; font-family: var(--font-mono); }

/* =================================================
   EMPTY STATE
   ================================================= */
.empty-state { text-align: center; padding: 48px 24px; color: var(--slate-500); }
.empty-state-icon { width: 64px; height: 64px; border-radius: var(--radius-md); background: var(--slate-100); color: var(--slate-400); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.empty-state-icon svg { width: 30px; height: 30px; }
.empty-state-title { font-size: 1.1rem; color: var(--slate-700); margin-bottom: 6px; }
.empty-state-text { font-size: 0.92rem; margin-bottom: 14px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* =================================================
   BLOCK PAGES (license blocked/expired)
   ================================================= */
.block-box { padding: 28px; border-radius: var(--radius-md); margin: 20px 0; text-align: center; border-left: 4px solid; }
.block-box--danger { background: var(--error-bg); border-left-color: var(--error); }
.block-box--warning { background: var(--warning-bg); border-left-color: var(--warning); }
.block-box .block-icon { width: 64px; height: 64px; border-radius: 50%; background: white; color: var(--error); font-size: 2.4rem; font-weight: 800; line-height: 1; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; box-shadow: var(--shadow-md); }
.block-box--warning .block-icon { color: var(--warning); }
.block-box h3 { margin-bottom: 10px; }

.info-panel { background: var(--slate-50); padding: 18px; border-radius: var(--radius); margin: 14px 0; text-align: left; }
.info-panel--blue { background: var(--info-bg); }
.info-panel h4 { margin-bottom: 8px; }
.info-panel p { margin: 4px 0; font-size: 0.92rem; color: var(--slate-700); }
.cta-row { display: flex; gap: 12px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.info-box { background: var(--info-bg); color: #1e3a8a; padding: 14px 16px; border-radius: var(--radius); font-size: 0.9rem; border-left: 3px solid var(--info); }

/* =================================================
   CRED BOX (kody, klucze)
   ================================================= */
.cred-box { background: var(--slate-50); padding: 16px 20px; border-radius: var(--radius); display: grid; gap: 10px; border: 1px solid var(--border); }
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; }
.cred-label { font-size: 0.82rem; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.cred-value { font-weight: 600; color: var(--slate-900); }
.cred-value--code { background: white; padding: 6px 10px; border-radius: 6px; font-family: var(--font-mono); border: 1px solid var(--border); user-select: all; word-break: break-all; }
.qr-container { padding: 16px; }
.secret-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.secret-wrap .secret-value { user-select: all; }
.secret-wrap .btn { padding: 6px 10px; min-width: 32px; }

/* =================================================
   SHORTCUT TILES
   ================================================= */
.shortcuts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.shortcut-tile {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 18px 12px; background: var(--slate-50); border-radius: var(--radius);
    color: var(--slate-700); transition: all var(--transition);
}
.shortcut-tile:hover { background: var(--primary-50); color: var(--primary-700); transform: translateY(-2px); }
.shortcut-icon { width: 38px; height: 38px; border-radius: 50%; background: white; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; color: var(--primary-600); }
.shortcut-label { font-size: 0.86rem; font-weight: 600; text-align: center; }

/* =================================================
   MEDIA GRID
   ================================================= */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all var(--transition); }
.media-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.media-thumb { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); position: relative; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb-placeholder { opacity: 0.5; }
.media-thumb-badge { position: absolute; top: 8px; right: 8px; padding: 3px 8px; background: rgba(15,23,42,0.7); color: white; border-radius: 999px; font-size: 0.72rem; font-weight: 600; backdrop-filter: blur(4px); }
.media-info { padding: 14px; }
.media-name { font-weight: 700; margin-bottom: 4px; color: var(--slate-900); }
.media-meta { font-size: 0.78rem; color: var(--slate-500); margin-bottom: 12px; }
.media-actions { display: flex; gap: 8px; }

.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.summary-row:last-child { border-bottom: 0; }

/* =================================================
   EDITOR (media_edit.php) - dark theme + multi-slide
   ================================================= */
.editor-body { overflow: hidden; height: 100vh; background: #0a1322; color: #cbd5e1; }
.editor-shell { display: flex; flex-direction: column; height: 100vh; }

.editor-topbar {
    display: flex; align-items: center; gap: 14px; padding: 12px 18px;
    background: linear-gradient(180deg, #131e35 0%, #0c1426 100%);
    border-bottom: 1px solid #1f2c47; flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.editor-back { display: inline-flex; align-items: center; gap: 6px; color: #cbd5e1; font-weight: 600; padding: 8px 12px; border-radius: 8px; transition: background var(--transition); }
.editor-back:hover { background: rgba(255,255,255,0.06); color: white; }
.editor-title-input {
    flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; color: white;
    font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; padding: 8px 12px; border-radius: 8px;
}
.editor-title-input:focus { outline: none; border-color: #2c3a5b; background: rgba(0,0,0,0.25); }
.editor-actions { display: flex; gap: 8px; }
.editor-actions .btn-secondary { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: #e2e8f0; }
.editor-actions .btn-secondary:hover { background: rgba(255,255,255,0.12); color: white; border-color: rgba(255,255,255,0.2); }
.editor-actions .btn-ghost { color: #cbd5e1; }
.editor-actions .btn-ghost:hover { background: rgba(255,255,255,0.06); color: white; }

.editor-main { flex: 1; display: grid; grid-template-columns: 280px 1fr 300px; min-height: 0; }
.editor-left, .editor-right {
    background: linear-gradient(180deg, #131e35 0%, #101a2f 100%);
    border-right: 1px solid #1f2c47;
    padding: 18px; overflow-y: auto;
}
.editor-right { border-right: 0; border-left: 1px solid #1f2c47; }
.editor-section { margin-bottom: 22px; }
.editor-section h4 {
    color: white; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.10em;
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.editor-section h4::before {
    content: ''; display: inline-block; width: 4px; height: 14px;
    background: linear-gradient(180deg, var(--accent-400), var(--accent-600));
    border-radius: 2px;
}
.editor-section .field-label { color: #94a3b8; margin-top: 10px; display: block; }
.editor-section .form-control { background: rgba(0,0,0,0.25); border-color: #2c3a5b; color: white; }
.editor-section .form-control:focus { border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(59,130,246,0.18); }
.editor-section .color-input { background: rgba(0,0,0,0.25); }

/* Tool grid (Add element) */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-btn {
    padding: 12px 8px; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
    color: #e2e8f0; font-weight: 600; font-size: 0.78rem; cursor: pointer;
    transition: all 180ms;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 64px;
}
.tool-btn svg { width: 20px; height: 20px; color: var(--accent-400); transition: color 180ms; }
.tool-btn:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    border-color: var(--primary-500); color: white; transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(37,99,235,0.4);
}
.tool-btn:hover svg { color: white; }

/* Templates */
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template-card {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 0; cursor: pointer; overflow: hidden;
    transition: all 180ms; text-align: left;
}
.template-card:hover { border-color: var(--primary-500); transform: translateY(-2px); box-shadow: 0 8px 18px -4px rgba(37,99,235,0.4); }
.template-thumb {
    width: 100%; aspect-ratio: 16/9;
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.85); font-family: var(--font-heading); font-weight: 700; font-size: 0.78rem;
}
.template-name { padding: 6px 8px; font-size: 0.78rem; color: #cbd5e1; font-weight: 600; }

/* Slides strip (under canvas) */
.slides-strip {
    display: flex; gap: 8px; padding: 10px 14px;
    background: linear-gradient(180deg, #101a2f 0%, #0a1322 100%);
    border-top: 1px solid #1f2c47;
    overflow-x: auto; flex-shrink: 0;
    min-height: 84px;
}
.slide-thumb {
    flex-shrink: 0; width: 110px; aspect-ratio: 16/9;
    border: 2px solid transparent; border-radius: 8px;
    background: #000; cursor: pointer; position: relative;
    transition: all 180ms; overflow: hidden;
}
.slide-thumb:hover { transform: translateY(-2px); }
.slide-thumb.active { border-color: var(--accent-400); box-shadow: 0 0 0 3px rgba(251,191,36,0.18); }
.slide-thumb-inner { position: absolute; inset: 0; overflow: hidden; }
.slide-thumb-num {
    position: absolute; top: 4px; left: 5px;
    background: rgba(0,0,0,0.7); color: white;
    padding: 1px 6px; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700; backdrop-filter: blur(2px);
}
.slide-thumb-dur {
    position: absolute; bottom: 4px; right: 5px;
    background: rgba(0,0,0,0.7); color: white;
    padding: 1px 5px; border-radius: 4px;
    font-size: 0.62rem; font-weight: 600;
}
.slide-thumb-del {
    position: absolute; top: 3px; right: 3px;
    background: var(--error); color: white;
    border: 0; width: 18px; height: 18px;
    border-radius: 50%; cursor: pointer; font-size: 0.7rem;
    display: none; align-items: center; justify-content: center;
    line-height: 1;
}
.slide-thumb:hover .slide-thumb-del { display: flex; }
.slide-add-btn {
    flex-shrink: 0; width: 110px; aspect-ratio: 16/9;
    border: 2px dashed rgba(255,255,255,0.18); border-radius: 8px;
    background: transparent; color: rgba(255,255,255,0.55);
    cursor: pointer; transition: all 180ms;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 0.72rem; font-weight: 600;
}
.slide-add-btn:hover { border-color: var(--accent-400); color: var(--accent-400); background: rgba(251,191,36,0.05); }
.slide-add-btn svg { width: 18px; height: 18px; }

/* Canvas area */
.editor-canvas-wrap {
    display: flex; flex-direction: column;
    background: #0a1322;
    min-height: 0; min-width: 0;
}
.editor-canvas-area {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 22px; min-height: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(37,99,235,0.05), transparent 50%),
        #0a1322;
}
.editor-canvas {
    position: relative; aspect-ratio: 16/9;
    width: 100%; max-width: 1280px; max-height: 100%;
    background: #000; box-shadow: 0 30px 80px rgba(0,0,0,0.6); overflow: hidden;
    user-select: none; border-radius: 6px;
}
.editor-canvas.drop-target { outline: 3px dashed var(--accent-400); outline-offset: -8px; }
.editor-hint { color: #64748b; font-size: 0.82rem; text-align: center; padding: 0 14px 10px; }

.canvas-el { position: absolute; cursor: move; outline: 2px solid transparent; transition: outline 100ms; display: flex; overflow: hidden; }
.canvas-el.selected { outline: 2px solid var(--accent-400); }
.canvas-el .handle {
    position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px;
    background: var(--accent-400); border: 2px solid white; border-radius: 50%;
    cursor: nwse-resize; box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    display: none;
}
.canvas-el.selected .handle { display: block; }

.props-field { margin-bottom: 12px; }
.props-field label { display: block; color: #94a3b8; font-size: 0.78rem; margin-bottom: 4px; }
.props-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Slide transition select inline pill */
.slide-meta-row {
    display: flex; gap: 8px; padding: 10px 14px;
    background: #0c1729; border-top: 1px solid #1f2c47;
    align-items: center; flex-wrap: wrap;
}
.slide-meta-row label { color: #94a3b8; font-size: 0.78rem; font-weight: 600; }
.slide-meta-row .form-control { width: auto; min-width: 110px; padding: 6px 10px; font-size: 0.82rem; background: rgba(0,0,0,0.3); border-color: #2c3a5b; color: white; }

/* Preview overlay (full-screen play) */
.preview-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: #000; display: none; align-items: center; justify-content: center;
}
.preview-overlay.is-open { display: flex; }
.preview-stage {
    position: relative; width: 100vw; height: 100vh; overflow: hidden;
    background: #000;
}
.preview-close {
    position: absolute; top: 18px; right: 18px; z-index: 100;
    background: rgba(0,0,0,0.5); color: white; border: 1px solid rgba(255,255,255,0.15);
    width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(8px);
}
.preview-close:hover { background: rgba(0,0,0,0.8); }
.preview-progress {
    position: absolute; top: 0; left: 0; height: 3px;
    background: var(--accent-400);
    z-index: 90; transition: width 100ms linear;
}

/* Slide rendering wrapper for transitions */
.preview-slide {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 600ms ease, transform 600ms ease;
}
.preview-slide.active { opacity: 1; transform: none; z-index: 2; }
.preview-slide.t-fade { opacity: 0; }
.preview-slide.t-fade.active { opacity: 1; }
.preview-slide.t-slide-left { transform: translateX(100%); opacity: 1; }
.preview-slide.t-slide-left.active { transform: translateX(0); }
.preview-slide.t-slide-left.out { transform: translateX(-100%); opacity: 1; }
.preview-slide.t-slide-right { transform: translateX(-100%); opacity: 1; }
.preview-slide.t-slide-right.active { transform: translateX(0); }
.preview-slide.t-slide-right.out { transform: translateX(100%); opacity: 1; }
.preview-slide.t-slide-up { transform: translateY(100%); opacity: 1; }
.preview-slide.t-slide-up.active { transform: translateY(0); }
.preview-slide.t-slide-up.out { transform: translateY(-100%); opacity: 1; }
.preview-slide.t-zoom { transform: scale(1.15); opacity: 0; }
.preview-slide.t-zoom.active { transform: scale(1); opacity: 1; }
.preview-slide.t-zoom.out { transform: scale(0.85); opacity: 0; }
.preview-slide.t-flip { transform: rotateY(90deg); opacity: 0; transform-origin: center; }
.preview-slide.t-flip.active { transform: rotateY(0); opacity: 1; }
.preview-slide.t-flip.out { transform: rotateY(-90deg); opacity: 0; }
.preview-slide.t-none { transition: none; opacity: 1; }

.ticker-anim { animation: tickerScroll var(--ticker-speed, 20s) linear infinite; }
@keyframes tickerScroll {
    from { transform: translateX(100%); }
    to   { transform: translateX(-100%); }
}

/* =================================================
   ANIMACJE ELEMENTÓW MEDIA (preview + canvas)
   ================================================= */
.el-anim-pulse        { animation: animPulse 1.8s ease-in-out infinite; }
.el-anim-bounce       { animation: animBounce 1.6s ease-in-out infinite; }
.el-anim-shake        { animation: animShake 1.2s ease-in-out infinite; }
.el-anim-fadeIn       { animation: animFadeIn 1.1s ease-out both; }
.el-anim-fadeInUp     { animation: animFadeInUp 1.0s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-fadeInDown   { animation: animFadeInDown 1.0s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-slideInLeft  { animation: animSlideInLeft 1.0s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-slideInRight { animation: animSlideInRight 1.0s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-slideInDown  { animation: animSlideInDown 1.0s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-bounceIn     { animation: animBounceIn 1.0s cubic-bezier(0.34,1.56,0.64,1) both; }
.el-anim-zoomIn       { animation: animZoomIn 0.9s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-glow         { animation: animGlow 2.2s ease-in-out infinite; }
.el-anim-float        { animation: animFloat 3.2s ease-in-out infinite; }
.el-anim-spin         { animation: animSpin 14s linear infinite; }
.el-anim-flip         { animation: animFlip 1.0s cubic-bezier(0.19,1,0.22,1) both; }
.el-anim-rubber       { animation: animRubber 1.3s ease-out both; }

@keyframes animPulse        { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes animBounce       { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes animShake        { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes animFadeIn       { from { opacity: 0; } to { opacity: 1; } }
@keyframes animFadeInUp     { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes animFadeInDown   { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes animSlideInLeft  { from { opacity: 0; transform: translateX(-60%); } to { opacity: 1; transform: translateX(0); } }
@keyframes animSlideInRight { from { opacity: 0; transform: translateX(60%); } to { opacity: 1; transform: translateX(0); } }
@keyframes animSlideInDown  { from { opacity: 0; transform: translateY(-60%); } to { opacity: 1; transform: translateY(0); } }
@keyframes animBounceIn     { 0% { opacity: 0; transform: scale(0.3); } 60% { opacity: 1; transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes animZoomIn       { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
@keyframes animGlow         { 0%,100% { filter: drop-shadow(0 0 8px currentColor); } 50% { filter: drop-shadow(0 0 28px currentColor); } }
@keyframes animFloat        { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes animSpin         { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes animFlip         { from { opacity: 0; transform: rotateY(90deg); } to { opacity: 1; transform: rotateY(0); } }
@keyframes animRubber       { 0% { transform: scale(1); } 30% { transform: scaleX(1.25) scaleY(0.75); } 40% { transform: scaleX(0.75) scaleY(1.25); } 60% { transform: scaleX(1.15) scaleY(0.85); } 100% { transform: scale(1); } }

/* =================================================
   PLAYLIST EKRANU (lista mediów z drag&drop + reguły czasowe)
   ================================================= */
.playlist-wrap { display: grid; gap: 10px; }
.playlist-item {
    display: grid;
    grid-template-columns: 32px 80px 1fr auto auto;
    gap: 14px; align-items: center;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 180ms;
}
.playlist-item:hover { border-color: var(--primary-300); box-shadow: var(--shadow-sm); }
.playlist-item.dragging { opacity: 0.4; }
.playlist-item.drop-above { border-top: 3px solid var(--primary-500); }
.playlist-item.drop-below { border-bottom: 3px solid var(--primary-500); }
.playlist-handle { cursor: grab; color: var(--slate-400); display: flex; align-items: center; justify-content: center; user-select: none; }
.playlist-handle:active { cursor: grabbing; }
.playlist-handle svg { width: 18px; height: 18px; }
.playlist-thumb {
    width: 80px; aspect-ratio: 16/9;
    background: var(--slate-100); border-radius: 6px;
    background-size: cover; background-position: center;
}
.playlist-info { min-width: 0; }
.playlist-name { font-weight: 600; color: var(--slate-900); margin-bottom: 4px; }
.playlist-rules { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.78rem; color: var(--slate-500); }
.playlist-rule-chip { background: var(--slate-100); color: var(--slate-700); padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.playlist-rule-chip--time { background: var(--primary-50); color: var(--primary-700); }
.playlist-rule-chip--days { background: var(--success-bg); color: #065f46; }
.playlist-rule-chip--date { background: var(--warning-bg); color: #78350f; }
.playlist-actions { display: flex; gap: 6px; }
.playlist-empty {
    padding: 40px 20px; text-align: center;
    border: 2px dashed var(--border); border-radius: var(--radius);
    color: var(--slate-500);
}
.playlist-add-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px; align-items: end;
    padding: 16px; background: var(--slate-50);
    border-radius: var(--radius); margin-bottom: 14px;
}
.playlist-add-form .form-group { margin: 0; }
@media (max-width: 900px) {
    .playlist-add-form { grid-template-columns: 1fr 1fr; }
    .playlist-item { grid-template-columns: 32px 60px 1fr auto; }
    .playlist-item .playlist-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--slate-700); border-radius: 50%;
    cursor: pointer; font-weight: 600; font-size: 0.86rem;
    transition: all 160ms; user-select: none;
}
.weekday-pill.active {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white; border-color: var(--primary-600);
    box-shadow: 0 4px 10px -2px rgba(37,99,235,0.4);
}
.weekday-pill:hover:not(.active) { border-color: var(--primary-400); }

.modal-overlay {
    position: fixed; inset: 0; z-index: 2500;
    display: none; align-items: center; justify-content: center;
    background: rgba(15,23,42,0.55); backdrop-filter: blur(6px); padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.18s ease; }
.modal-box {
    background: var(--surface); border-radius: 16px; max-width: 520px; width: 100%;
    box-shadow: 0 30px 60px rgba(0,0,0,0.30); overflow: hidden;
    animation: popupIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; }
.modal-close { background: transparent; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--slate-500); padding: 0 6px; }
.modal-body { padding: 22px; max-height: 70vh; overflow-y: auto; }


/* =================================================
   EDITOR - QMS KIOSK
   ================================================= */
.editor-main--3col { grid-template-columns: 280px 1fr 300px; }
.tree-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.node-list { display: grid; gap: 6px; }
.node-item { display: flex; gap: 4px; }
.node-name { flex: 1; padding: 9px 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); color: #cbd5e1; border-radius: 8px; text-align: left; cursor: pointer; font-size: 0.86rem; transition: all var(--transition); }
.node-name:hover { background: var(--primary-700); color: white; border-color: var(--primary-600); }
.node-item.active .node-name { background: var(--primary-600); color: white; border-color: var(--primary-500); }
.node-del { width: 32px; background: transparent; border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; border-radius: 8px; cursor: pointer; font-size: 1.1rem; }
.node-del:hover { background: var(--error); color: white; }

.kiosk-preview { width: 100%; max-width: 1200px; aspect-ratio: 16/9; padding: 36px; border-radius: 12px; overflow: auto; }
.kiosk-title { font-family: var(--font-heading); font-size: 2rem; font-weight: 800; text-align: center; margin-bottom: 26px; }
.kiosk-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.kiosk-btn { padding: 22px 18px; border: 3px solid transparent; border-radius: 14px; cursor: pointer; color: white; text-align: left; transition: transform 120ms, border-color 120ms; box-shadow: 0 8px 16px -8px rgba(0,0,0,0.4); }
.kiosk-btn:hover { transform: translateY(-2px); }
.kiosk-btn.selected { border-color: #fbbf24; transform: translateY(-2px); }
.kiosk-btn-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; }
.kiosk-btn-sub { font-size: 0.92rem; opacity: 0.85; margin-top: 4px; }
.kiosk-empty { grid-column: 1/-1; color: #64748b; text-align: center; padding: 40px; }
.kiosk-breadcrumb { color: #94a3b8; font-size: 0.84rem; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; padding: 10px; background: var(--slate-50); border-radius: var(--radius); }

/* =================================================
   RESPONSYWNOŚĆ
   ================================================= */
@media (max-width: 900px) {
    .landing-left { display: none; }
    .landing-right { flex: 1; max-width: 100%; padding: 24px; }
    .landing-box .logo-mobile { display: block; }
    .sidebar { position: fixed; left: -300px; top: 0; bottom: 0; transition: left var(--transition); }
    .sidebar.open { left: 0; }
    .overlay.open { display: block; }
    .mobile-header { display: flex; }
    .page-container { padding: 18px; }
    .form-row { grid-template-columns: 1fr; }
    .editor-main { grid-template-columns: 1fr; }
    .editor-left, .editor-right { display: none; }
    .editor-left.open, .editor-right.open { display: block; position: fixed; top: 0; bottom: 0; width: 280px; z-index: 90; }
    .editor-left.open { left: 0; }
    .editor-right.open { right: 0; }
    .landing-single { padding: 20px 14px; }
    .landing-single .landing-box { padding: 26px 22px; }
    .landing-single h2 { font-size: 1.35rem; }
    .landing-deco-blob { width: 320px; height: 320px; right: -120px; }
    .landing-deco-blob--accent { width: 220px; height: 220px; left: -80px; bottom: -80px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-value { font-size: 1.15rem; }
}

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; }
    .landing-single h2 { font-size: 1.2rem; }
    .landing-single .subtitle { font-size: 0.88rem; }
    .cta-row .btn { width: 100%; }
    .page-container { padding: 14px; }
    .page-title { font-size: 1.3rem; }
}

/* Utility: gradient text */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-900) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   QMS – ŚRODOWISKO TESTOWE
   ============================================================ */
.qms-test-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.qms-test-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.18s, background 0.18s, transform 0.18s;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}
.qms-test-tab:hover { color: #1e293b; background: rgba(37,99,235,0.06); }
.qms-test-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: linear-gradient(180deg, rgba(37,99,235,0.06), transparent);
}
.qms-test-panel { display: none; animation: fadeIn 0.25s ease; }
.qms-test-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }

/* Operator emulator */
.operator-shell {
    background: linear-gradient(135deg, #0b1f3a 0%, #1e3a8a 60%, #2563eb 130%);
    border-radius: 18px;
    padding: 28px;
    color: #fff;
    box-shadow: 0 18px 48px rgba(11,31,58,0.35);
    position: relative;
    overflow: hidden;
}
.operator-shell::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 30% 20%, rgba(251,191,36,0.10), transparent 50%);
    pointer-events: none;
}
.operator-header { position: relative; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.operator-header .form-group label { color: rgba(255,255,255,0.7); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.operator-header .form-control {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    color: #fff;
    backdrop-filter: blur(8px);
}
.operator-header .form-control option { background: #0b1f3a; color: #fff; }
.operator-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.op-meta-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 12px 18px;
    min-width: 140px;
    backdrop-filter: blur(8px);
}
.op-meta-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.65); margin-bottom: 4px; }
.op-meta-value { font-family: 'JetBrains Mono', monospace; font-size: 1.55rem; font-weight: 700; color: #fff; }
.op-current-card { background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(245,158,11,0.10)); border-color: rgba(251,191,36,0.35); }
.op-current { color: #fbbf24; }

.operator-actions {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.op-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 16px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 14px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s, box-shadow 0.18s;
    backdrop-filter: blur(8px);
}
.op-action:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,0.20); }
.op-action:active { transform: translateY(0); }
.op-action.op-primary { background: linear-gradient(135deg, #2563eb, #1e40af); border-color: #3b82f6; }
.op-action.op-primary:hover { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.op-action.op-warning { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #fbbf24; }
.op-action.op-success { background: linear-gradient(135deg, #16a34a, #15803d); border-color: #22c55e; }

.operator-list { position: relative; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; padding: 18px; }
.op-queue-head { font-weight: 700; color: #fff; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.op-queue-items { display: flex; flex-wrap: wrap; gap: 8px; }
.op-queue-item { font-family: 'JetBrains Mono', monospace; background: rgba(251,191,36,0.18); color: #fde68a; padding: 6px 12px; border-radius: 6px; font-weight: 700; border: 1px solid rgba(251,191,36,0.35); }
.op-queue-empty { color: rgba(255,255,255,0.55); font-style: italic; }

/* Modal QMS */
.qms-modal {
    position: fixed; inset: 0; background: rgba(11,31,58,0.65); backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.qms-modal.show { display: flex; animation: fadeIn 0.18s ease; }
.qms-modal-box { background: #fff; border-radius: 16px; max-width: 480px; width: 100%; box-shadow: 0 26px 60px rgba(0,0,0,0.35); overflow: hidden; }
.qms-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.qms-modal-head h3 { margin: 0; font-size: 1.05rem; color: #0f172a; }
.qms-modal-close { background: transparent; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #64748b; padding: 0 6px; }
.qms-modal-body { padding: 20px 22px; max-height: 60vh; overflow-y: auto; }
.op-list-item {
    display: inline-block; margin: 4px; padding: 10px 16px; font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; border: none;
    border-radius: 8px; font-weight: 700; cursor: pointer; transition: transform 0.16s;
}
.op-list-item:hover { transform: scale(1.06); }

/* Call popup */
.call-popup {
    position: fixed; inset: 0; background: rgba(11,31,58,0.92); display: none;
    align-items: center; justify-content: center; z-index: 1500;
}
.call-popup.show { display: flex; animation: popupIn 0.45s cubic-bezier(.18,.89,.32,1.28); }
@keyframes popupIn { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
.call-popup-box {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff; padding: 60px 80px; border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 0 60px rgba(251,191,36,0.08);
    border: 2px solid rgba(251,191,36,0.4);
    text-align: center;
}
.call-popup-row { margin: 16px 0; }
.call-popup-label { font-size: 1rem; font-weight: 700; letter-spacing: 0.18em; color: rgba(251,191,36,0.85); text-transform: uppercase; margin-bottom: 8px; }
.call-popup-value { font-family: 'JetBrains Mono', monospace; font-size: 5.6rem; font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 4px 30px rgba(251,191,36,0.55); }

/* Kiosk emulator */
.kiosk-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.kiosk-info { margin-bottom: 18px; }
.kiosk-emulator {
    position: fixed; inset: 0; background: #0b1f3a; display: none; z-index: 2000;
    flex-direction: column;
}
.kiosk-emulator.show { display: flex; }
.kiosk-emu-close {
    position: absolute; top: 16px; right: 20px; background: rgba(255,255,255,0.1);
    color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
    width: 44px; height: 44px; font-size: 1.6rem; cursor: pointer; z-index: 10;
    transition: background 0.18s; backdrop-filter: blur(6px);
}
.kiosk-emu-close:hover { background: rgba(239,68,68,0.85); }
.kiosk-emu-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.kiosk-screen { width: 100%; max-width: 1100px; }
.kiosk-screen-header { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; margin-bottom: 48px; }
.kiosk-title { font-size: 3rem; color: #fff; margin: 0; text-align: center; font-family: 'Outfit', sans-serif; }
.kiosk-back { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 14px 22px; border-radius: 10px; font-size: 1.1rem; cursor: pointer; justify-self: start; }
.kiosk-back:hover { background: rgba(255,255,255,0.2); }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.kiosk-btn {
    background: linear-gradient(135deg, rgba(37,99,235,0.85), rgba(30,64,175,0.85));
    border: 2px solid rgba(251,191,36,0.4);
    color: #fff; padding: 36px 28px; border-radius: 16px;
    font-family: 'Outfit', sans-serif; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-align: left;
}
.kiosk-btn:hover { transform: translateY(-4px); box-shadow: 0 22px 50px rgba(0,0,0,0.4); border-color: #fbbf24; }
.kiosk-btn-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.kiosk-btn-desc { font-size: 1rem; opacity: 0.8; line-height: 1.4; }
.kiosk-empty { grid-column: 1/-1; color: rgba(255,255,255,0.6); text-align: center; padding: 40px; font-style: italic; }

.kiosk-ticket-screen { display: flex; align-items: center; justify-content: center; }
.kiosk-ticket-box {
    background: linear-gradient(135deg, #1e3a8a, #0b1f3a);
    border: 2px solid rgba(251,191,36,0.55);
    border-radius: 20px; padding: 60px 80px; text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    animation: popupIn 0.5s cubic-bezier(.18,.89,.32,1.28);
}
.kiosk-ticket-label { font-size: 1.4rem; color: #fbbf24; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 18px; }
.kiosk-ticket-num { font-family: 'JetBrains Mono', monospace; font-size: 8rem; font-weight: 900; color: #fff; line-height: 1; margin-bottom: 18px; text-shadow: 0 6px 36px rgba(251,191,36,0.55); }
.kiosk-ticket-dept { font-size: 1.6rem; color: #cbd5e1; font-weight: 600; margin-bottom: 16px; }
.kiosk-ticket-msg { font-size: 1.2rem; color: #fde68a; max-width: 480px; margin: 0 auto; line-height: 1.4; }
