/* ============================================================
   GM Social — Design System (Light Premium)
   Upgraded: spacious, polished, SaaS-grade UX
   ============================================================ */

/* --- Variables --- */
:root {
    --bg-page: #f8f9fc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1e2e;
    --bg-sidebar-hover: #2a2a3d;
    --bg-sidebar-active: #363650;
    --text-primary: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #b0b4c8;
    --text-sidebar-active: #ffffff;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-light: #f0f9ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #8b5cf6;
    --info-light: #f5f3ff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --sidebar-width: 252px;
    --topbar-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Theme --- */
html.dark {
    --bg-page: #0a0a10;
    --bg-card: #111118;
    --bg-sidebar: #0c0c14;
    --bg-sidebar-hover: #1a1a28;
    --bg-sidebar-active: #222236;
    --text-primary: #e8e8f0;
    --text-secondary: #8e8ea0;
    --text-muted: #55556a;
    --text-sidebar: #8888a0;
    --text-sidebar-active: #ffffff;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-light: rgba(14,165,233,.08);
    --success: #22c55e;
    --success-light: rgba(34,197,94,.1);
    --warning: #f59e0b;
    --warning-light: rgba(245,158,11,.1);
    --danger: #ef4444;
    --danger-light: rgba(239,68,68,.1);
    --info: #a78bfa;
    --info-light: rgba(139,92,246,.1);
    --border: rgba(255,255,255,.08);
    --border-light: rgba(255,255,255,.04);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 12px 24px rgba(0,0,0,.5);
    --shadow-hover: 0 8px 24px rgba(0,0,0,.4);
}
html.dark body { background: var(--bg-page); color: var(--text-primary); }
html.dark .sidebar { background: var(--bg-sidebar); border-right: 1px solid rgba(255,255,255,.04); }
html.dark .topbar { background: rgba(10,10,16,.85); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.04); }
html.dark .card { background: var(--bg-card); border-color: rgba(255,255,255,.06); }
html.dark .card-header { border-color: rgba(255,255,255,.06); }
html.dark .card-footer { border-color: rgba(255,255,255,.06); }
html.dark table th { background: rgba(255,255,255,.03); color: var(--text-secondary); }
html.dark table td { border-color: rgba(255,255,255,.03); }
html.dark table tr:hover td { background: rgba(255,255,255,.02); }
html.dark input, html.dark select, html.dark textarea { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: var(--text-primary); }
html.dark input:focus, html.dark select:focus, html.dark textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,189,248,.1); }
html.dark input::placeholder, html.dark textarea::placeholder { color: var(--text-muted); }
html.dark .btn-outline { border-color: rgba(255,255,255,.1); color: var(--text-primary); }
html.dark .btn-outline:hover { background: rgba(255,255,255,.05); }
html.dark .stat-card { background: var(--bg-card); border-color: rgba(255,255,255,.06); }
html.dark .stat-icon { opacity: .9; }
html.dark .alert { border-color: rgba(255,255,255,.06); }
html.dark .alert-success { background: rgba(34,197,94,.08); color: #4ade80; border-color: rgba(34,197,94,.15); }
html.dark .alert-danger { background: rgba(239,68,68,.08); color: #f87171; border-color: rgba(239,68,68,.15); }
html.dark .alert-warning { background: rgba(245,158,11,.08); color: #fbbf24; border-color: rgba(245,158,11,.15); }
html.dark .alert-info { background: rgba(139,92,246,.08); color: #a78bfa; border-color: rgba(139,92,246,.15); }
html.dark .badge-bozza { background: rgba(255,255,255,.06); color: #94a3b8; }
html.dark .badge-pronto { background: rgba(14,165,233,.1); color: #38bdf8; }
html.dark .badge-approvato, html.dark .badge-completato { background: rgba(34,197,94,.1); color: #4ade80; }
html.dark .badge-pubblicato { background: rgba(139,92,246,.1); color: #a78bfa; }
html.dark .badge-rifiutato, html.dark .badge-danger { background: rgba(239,68,68,.1); color: #f87171; }
html.dark .badge-in_lavorazione { background: rgba(14,165,233,.1); color: #38bdf8; }
html.dark .format-post { background: rgba(59,130,246,.1); color: #60a5fa; }
html.dark .format-storia { background: rgba(236,72,153,.1); color: #f472b6; }
html.dark .format-reel { background: rgba(139,92,246,.1); color: #a78bfa; }
html.dark .format-carosello { background: rgba(16,185,129,.1); color: #34d399; }
html.dark .format-repost { background: rgba(245,158,11,.1); color: #fbbf24; }
html.dark .platform-tag { border-color: rgba(255,255,255,.08); }
html.dark .progress-bar-wrap { background: rgba(255,255,255,.06); }
html.dark .empty-state { color: var(--text-muted); }
html.dark .form-hint { color: var(--text-muted); }
html.dark .sidebar-footer { border-color: rgba(255,255,255,.06); }
html.dark .welcome-header .welcome-title { color: var(--text-primary); }
html.dark .topbar-breadcrumb a { color: var(--text-secondary); }
html.dark .topbar-breadcrumb span { color: var(--text-muted); }
html.dark .topbar-icon-btn { color: var(--text-muted); }
html.dark .topbar-icon-btn:hover { color: var(--text-primary); background: rgba(255,255,255,.05); }
html.dark .media-grid .media-item { border-color: rgba(255,255,255,.06); }
html.dark .upload-area { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.02); color: var(--text-muted); }
html.dark .revision-list .revision-details { color: var(--text-muted); }
html.dark .search-overlay > div { background: var(--bg-card); }
html.dark #search-input { color: var(--text-primary); }

/* Dark transition */
html.dark *, html.dark *::before, html.dark *::after {
    transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: var(--font);
    font-weight: 400;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
h4 { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(14,165,233,0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.3) 0%, transparent 50%);
    pointer-events: none;
}
.login-container { width: 100%; max-width: 420px; padding: 1.25rem; position: relative; z-index: 1; }
.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
    padding: 2.75rem 2.5rem;
    animation: fadeInUp 0.5s ease-out;
}
.login-header { text-align: center; margin-bottom: 2.25rem; }
.login-logo {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--accent) 0%, #38bdf8 100%);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}
.login-logo i { font-size: 1.5rem; color: #fff; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.375rem; letter-spacing: -0.02em; }
.login-header p { color: var(--text-secondary); font-size: 0.875rem; }
.login-form .form-group { margin-bottom: 1.375rem; }
.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

/* --- Layout --- */
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1e2e 0%, #191928 50%, #151524 100%);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    border-right: 1px solid rgba(255,255,255,0.04);
}
.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.375rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand i {
    font-size: 1.25rem;
    color: var(--accent);
    margin-right: 0.75rem;
    background: rgba(14,165,233,0.12);
    width: 34px; height: 34px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.sidebar-brand:hover i { background: rgba(14,165,233,0.2); }
.sidebar-brand span {
    color: #fff;
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}
.sidebar-nav { flex: 1; padding: 0.875rem 0; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.6875rem 1.375rem;
    color: var(--text-sidebar);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    border-radius: 0;
    margin: 1px 0;
    position: relative;
    letter-spacing: 0.005em;
}
.sidebar-nav a i {
    width: 20px;
    margin-right: 0.8125rem;
    font-size: 1.0625rem;
    text-align: center;
    opacity: 0.8;
    transition: opacity var(--transition);
}
.sidebar-nav a:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}
.sidebar-nav a:hover i { opacity: 1; }
.sidebar-nav a.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
}
.sidebar-nav a.active i { opacity: 1; }
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: linear-gradient(180deg, var(--accent) 0%, #38bdf8 100%);
    border-radius: 0 3px 3px 0;
}
.sidebar-section {
    padding: 1.25rem 1.375rem 0.5rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.25);
    font-weight: 600;
}
.sidebar-footer {
    padding: 1.125rem 1.375rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-footer a {
    color: var(--text-sidebar);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}
.sidebar-footer a i { margin-right: 0.5rem; }
.sidebar-footer a:hover { color: var(--danger); }

/* Sidebar badge counter */
.sidebar-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.375rem;
    line-height: 1;
}

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

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { flex: 1; display: flex; align-items: center; gap: 0.875rem; }
.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.topbar-breadcrumb a { color: var(--text-secondary); transition: color var(--transition); }
.topbar-breadcrumb a:hover { color: var(--accent); }
.topbar-breadcrumb .separator { color: var(--text-muted); font-size: 0.75rem; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

/* Topbar quick actions */
.topbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.topbar-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 1rem;
}
.topbar-icon-btn:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}
.topbar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    line-height: 1;
}
.topbar-avatar {
    margin-left: 0.25rem;
}
.topbar-avatar .avatar-circle {
    width: 30px;
    height: 30px;
    font-size: 0.6875rem;
}
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}
.mobile-toggle:hover { background: var(--border-light); }

/* Content area */
.content {
    padding: 2rem;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    animation: fadeInUp 0.3s ease-out;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}
.card-header {
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.card-body { padding: 1.375rem; }
.card-footer {
    padding: 0.875rem 1.375rem;
    border-top: 1px solid var(--border);
    background: var(--bg-page);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* --- Stat Cards --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.125rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.375rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}
.stat-card:nth-child(2) { border-left-color: var(--success); }
.stat-card:nth-child(3) { border-left-color: var(--warning); }
.stat-card:nth-child(4) { border-left-color: var(--info); }
.stat-card:nth-child(5) { border-left-color: var(--danger); }
.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1875rem;
    flex-shrink: 0;
}
.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-content { flex: 1; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.stat-label { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.25rem; font-weight: 450; }

/* --- Forms --- */
label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--text-primary);
    margin-bottom: 0.4375rem;
    letter-spacing: 0.005em;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    height: 42px;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}
textarea { height: auto; }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.12), 0 0 0 1px rgba(14,165,233,0.3);
    background: #fff;
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}
textarea { resize: vertical; min-height: 110px; }
.input-icon {
    position: relative;
}
.input-icon i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9375rem;
    transition: color var(--transition);
}
.input-icon input:focus + i,
.input-icon:focus-within i { color: var(--accent); }
.input-icon input { padding-left: 2.5rem; }
.form-group { margin-bottom: 1.125rem; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3125rem; }

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    font-weight: 400;
    cursor: pointer;
    padding: 0.4375rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 0.875rem;
}
.checkbox-group label:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.checkbox-group input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.checkbox-group input[type="checkbox"]:checked + span {
    color: var(--accent);
    font-weight: 500;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.5625rem 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 550;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
    text-decoration: none;
    position: relative;
    user-select: none;
}
.btn i { font-size: 0.9375rem; }
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #38bdf8 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(14,165,233,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 3px 8px rgba(14,165,233,0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.97); box-shadow: 0 1px 2px rgba(14,165,233,0.25); }
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(16,185,129,0.3);
}
.btn-success:hover { background: linear-gradient(135deg, #059669 0%, var(--success) 100%); color: #fff; transform: translateY(-1px); }
.btn-success:active { transform: translateY(0) scale(0.97); }
.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(245,158,11,0.3);
}
.btn-warning:hover { background: linear-gradient(135deg, #d97706 0%, var(--warning) 100%); color: #fff; transform: translateY(-1px); }
.btn-warning:active { transform: translateY(0) scale(0.97); }
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}
.btn-danger:hover { background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%); color: #fff; transform: translateY(-1px); }
.btn-danger:active { transform: translateY(0) scale(0.97); }
.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-page);
    border-color: var(--text-muted);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.btn-outline:active { transform: translateY(0) scale(0.97); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-block { width: 100%; justify-content: center; padding: 0.6875rem 1.125rem; }
.btn-group { display: flex; gap: 0.5rem; align-items: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Loading button state */
.btn.loading {
    color: transparent;
    pointer-events: none;
    position: relative;
}
.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn-outline.loading::after {
    border-color: rgba(0,0,0,0.15);
    border-top-color: var(--text-primary);
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
thead th {
    background: var(--bg-page);
    padding: 0.8125rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
tbody td {
    padding: 0.8125rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
tbody tr {
    transition: background var(--transition);
}
tbody tr:hover { background: var(--accent-light); }
tbody tr:last-child td { border-bottom: none; }
td .cell-main { font-weight: 500; }
td .cell-sub { font-size: 0.8125rem; color: var(--text-secondary); }
.table-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-muted);
}
.table-empty i { font-size: 2.25rem; display: block; margin-bottom: 0.875rem; opacity: 0.6; }

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.badge-bozza { background: #f1f5f9; color: #475569; }
.badge-in_lavorazione { background: var(--warning-light); color: #92400e; }
.badge-completato { background: var(--info-light); color: #6d28d9; }
.badge-approvato { background: var(--success-light); color: #065f46; }
.badge-pronto { background: var(--accent-light); color: #0369a1; }
.badge-pubblicato { background: var(--success-light); color: #065f46; }
.badge-rifiutato { background: var(--danger-light); color: #991b1b; }

/* --- Alerts / Flash --- */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    animation: slideInDown 0.35s ease-out;
    font-weight: 450;
}
.alert i { font-size: 1.125rem; flex-shrink: 0; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* Toast alerts (positioned top-right) */
.toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9000;
    min-width: 320px;
    max-width: 440px;
    padding: 0.9375rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.4s ease-out;
    pointer-events: auto;
}
.toast i { font-size: 1.125rem; flex-shrink: 0; }
.toast-success { background: #065f46; color: #fff; }
.toast-danger { background: #991b1b; color: #fff; }
.toast-warning { background: #92400e; color: #fff; }
.toast-info { background: #1e40af; color: #fff; }
.toast-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.125rem;
    line-height: 1;
    transition: color var(--transition);
}
.toast-dismiss:hover { color: #fff; }

/* --- Format tags --- */
.format-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.1875rem 0.5625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.format-tag i { font-size: 0.8125rem; }
.format-post { background: #dbeafe; color: #1d4ed8; }
.format-storia { background: #fce7f3; color: #be185d; }
.format-reel { background: #f5f3ff; color: #7c3aed; }
.format-carosello { background: #ecfdf5; color: #059669; }
.format-repost { background: #fef3c7; color: #b45309; }

/* Format selector */
.format-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.format-selector label {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.5625rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
}
.format-selector label:hover { border-color: var(--accent); background: var(--accent-light); }
.format-selector input[type="radio"] { display: none; }
.format-selector input[type="radio"]:checked + span {
    color: var(--accent);
}
.format-selector label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 1px rgba(14,165,233,0.15);
}

/* Drive link */
.drive-link-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    background: var(--bg-card);
    transition: border-color var(--transition);
}
.drive-link-item:hover { border-color: var(--accent); }
.drive-link-item i { color: var(--accent); }
.drive-link-item a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-link-item .btn { flex-shrink: 0; }

/* --- Filters bar --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.125rem;
}
.filters select,
.filters input[type="search"] {
    width: auto;
    min-width: 170px;
    height: 38px;
    font-size: 0.8125rem;
}
.filters .filter-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-left: auto;
    font-weight: 450;
}

/* --- Avatar --- */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.avatar-circle.lg { width: 38px; height: 38px; font-size: 0.9375rem; }

/* --- Revisioni timeline --- */
.revision-list { list-style: none; padding: 0; }
.revision-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}
.revision-item:last-child { border-bottom: none; }
.revision-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.revision-icon.created { background: var(--accent-light); color: var(--accent); }
.revision-icon.edited { background: var(--warning-light); color: var(--warning); }
.revision-icon.approved { background: var(--success-light); color: var(--success); }
.revision-icon.rejected { background: var(--danger-light); color: var(--danger); }
.revision-icon.status { background: var(--info-light); color: var(--info); }
.revision-icon.comment { background: #f1f5f9; color: #475569; }
.revision-content { flex: 1; }
.revision-meta { font-size: 0.75rem; color: var(--text-muted); }
.revision-details { color: var(--text-secondary); margin-top: 0.1875rem; }

/* --- Calendar Grid --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.calendar-header {
    background: var(--bg-page);
    padding: 0.6875rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.calendar-day {
    background: var(--bg-card);
    min-height: 130px;
    padding: 0.625rem;
    position: relative;
    transition: background var(--transition);
}
.calendar-day:hover { background: #fafbff; }
.calendar-day.other-month { background: var(--bg-page); opacity: 0.5; }
.calendar-day.today { background: var(--accent-light); }
.calendar-day-number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}
.calendar-day.today .calendar-day-number {
    color: var(--accent);
    background: var(--accent);
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.calendar-post {
    display: block;
    padding: 0.3125rem 0.4375rem;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    margin-bottom: 0.3125rem;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity var(--transition), transform var(--transition);
    font-weight: 500;
}
.calendar-post:hover { opacity: 0.85; color: #fff; transform: translateX(1px); }
.calendar-post.bozza { background: #94a3b8; }
.calendar-post.pronto { background: var(--accent); }
.calendar-post.approvato { background: var(--success); }
.calendar-post.pubblicato { background: #6d28d9; }
.calendar-post.rifiutato { background: var(--danger); }
.calendar-add {
    display: block;
    text-align: center;
    padding: 0.1875rem;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: all var(--transition);
}
.calendar-add:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* --- Media Upload --- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.upload-area i { font-size: 2.25rem; color: var(--text-muted); display: block; margin-bottom: 0.625rem; }
.upload-area p { font-size: 0.875rem; color: var(--text-secondary); }

.upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.875rem;
    margin-top: 1.125rem;
}
.upload-preview-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-align: center;
    transition: border-color var(--transition);
}
.upload-preview-item:hover { border-color: var(--accent); }
.upload-preview-item img,
.upload-preview-item video {
    width: 100%;
    height: 90px;
    object-fit: cover;
}
.upload-preview-name {
    display: block;
    padding: 0.3125rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Media grid (existing uploads) */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.875rem;
}
.media-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: grab;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.media-item:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.media-item.dragging { opacity: 0.4; }
.media-item.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(14,165,233,0.2); }
.media-item img,
.media-item video {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}
.media-item-actions {
    position: absolute;
    top: 0.4375rem;
    right: 0.4375rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.media-item:hover .media-item-actions { opacity: 1; }
.media-item-actions .btn {
    padding: 0.25rem 0.4375rem;
    font-size: 0.6875rem;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    border-radius: var(--radius-xs);
}
.media-item-actions .btn:hover { background: var(--danger); }
.media-item-label {
    padding: 0.4375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    gap: 0.3125rem;
}
.media-item-label i { font-size: 0.8125rem; }

/* --- Platform icons --- */
.platform-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.1875rem 0.5625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.platform-tag.instagram { background: #fce7f3; color: #be185d; }
.platform-tag.facebook { background: #dbeafe; color: #1d4ed8; }
.platform-tag.linkedin { background: #e0f2fe; color: #0369a1; }
.platform-tag.tiktok { background: #f1f5f9; color: #0f172a; }
.platform-tag.youtube { background: var(--danger-light); color: #dc2626; }
.platform-tag.x { background: #f1f5f9; color: #0f172a; }

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    margin-top: 1.75rem;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.pagination a:hover { background: var(--border-light); color: var(--text-primary); }
.pagination .active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(14,165,233,0.3);
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 5rem 2.5rem;
    color: var(--text-muted);
    animation: fadeIn 0.4s ease-out;
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    display: block;
    opacity: 0.4;
}
.empty-state h3 {
    font-size: 1.1875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
}
.empty-state p { margin-bottom: 1.75rem; font-size: 0.9375rem; }

/* --- Public page --- */
.public-page {
    background: var(--bg-page);
    min-height: 100vh;
}
.public-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    color: #fff;
    padding: 2.5rem 2rem;
    text-align: center;
}
.public-header h1 { font-size: 1.625rem; font-weight: 700; margin-bottom: 0.375rem; letter-spacing: -0.02em; }
.public-header p { opacity: 0.8; font-size: 0.9375rem; }
.public-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.75rem;
}
.public-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.public-post:hover { box-shadow: var(--shadow-md); }
.public-post-header {
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.public-post-date {
    font-weight: 600;
    font-size: 1rem;
}
.public-post-body { padding: 1.375rem; }
.public-post-media {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.125rem;
}
.public-post-media img,
.public-post-media video {
    width: 100%;
    border-radius: var(--radius-sm);
    max-height: 300px;
    object-fit: cover;
}
.public-post-copy {
    font-size: 0.9375rem;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 1.125rem;
}
.public-post-platforms {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.125rem;
}
.public-post-actions {
    padding: 1.125rem 1.375rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    align-items: center;
}
.public-comments {
    padding: 1.125rem 1.375rem;
    border-top: 1px solid var(--border);
    background: var(--bg-page);
}
.public-comment {
    padding: 0.6875rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}
.public-comment:last-child { border-bottom: none; }
.public-comment-author { font-weight: 600; }
.public-comment-time { font-size: 0.75rem; color: var(--text-muted); }
.public-comment-text { margin-top: 0.3125rem; }
.comment-form {
    display: flex;
    gap: 0.625rem;
    margin-top: 0.875rem;
}
.comment-form input[type="text"],
.comment-form textarea {
    flex: 1;
    min-height: auto;
}

/* --- Summary/Riepilogo --- */
.riepilogo-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    color: #fff;
    padding: 3.25rem 2.25rem;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 2.25rem;
}
.riepilogo-header h1 { font-size: 2.125rem; font-weight: 700; letter-spacing: -0.02em; }
.riepilogo-header p { opacity: 0.8; margin-top: 0.5rem; font-size: 1rem; }
.riepilogo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.125rem;
    margin-bottom: 2.25rem;
}
.riepilogo-stat {
    text-align: center;
    padding: 1.375rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow var(--transition), transform var(--transition);
}
.riepilogo-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.riepilogo-stat-value { font-size: 2.125rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.riepilogo-stat-label { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.125rem; }

/* --- Timeline view --- */
.timeline { list-style: none; }
.timeline-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.6875rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-time { font-size: 0.75rem; color: var(--text-muted); }

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.75rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 0.25s ease-out;
}
.modal-header {
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); background: var(--border-light); }
.modal-body { padding: 1.375rem; }
.modal-footer {
    padding: 0.875rem 1.375rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* --- Lightbox --- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    cursor: default;
    animation: fadeIn 0.25s ease-out;
}
.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.75rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition);
    z-index: 10000;
    line-height: 1;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all var(--transition);
    z-index: 10000;
    backdrop-filter: blur(4px);
}
.lightbox-nav:hover { opacity: 1; background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-counter {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    font-family: var(--font);
    font-weight: 500;
}
.lightbox-trigger { cursor: zoom-in; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* --- Scrollbar (global subtle style) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* --- Skeleton loading placeholder --- */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .mobile-toggle { display: block; }
    .content { padding: 1.125rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .filters { flex-direction: column; }
    .filters select,
    .filters input[type="search"] { width: 100%; }
    .topbar-breadcrumb { display: none; }
    .topbar { padding: 0 1.125rem; }
    table { font-size: 0.8125rem; }
    .btn-group { flex-wrap: wrap; }
    .calendar-grid { grid-template-columns: 1fr; }
    .calendar-header { display: none; }
    .calendar-day { min-height: auto; }
    .calendar-day.other-month { display: none; }
    .public-post-media { grid-template-columns: 1fr; }
    .toast { left: 1rem; right: 1rem; min-width: auto; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 1.75rem; }
    .content { padding: 0.875rem; }
}

/* --- ADS Badge --- */
.badge-ads {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    background: #fdf2f8;
    color: #db2777;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}
.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #db2777;
}

/* --- Richieste modifiche --- */
.richiesta-item {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.richiesta-item:last-child { border-bottom: none; }
.richiesta-item.risolta { opacity: 0.6; }
.richiesta-autore {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
}
.richiesta-testo {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    line-height: 1.5;
}
.badge-richieste {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Drive Video Preview --- */
.drive-preview-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #000;
}
.drive-preview-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.drive-preview-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.drive-preview-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}
