/* ============================================
   Digo.Social — Apple-inspired Design System
   ============================================ */

/* ---- Design Tokens ---- */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 64px;
    --navbar-height: 56px;

    /* Brand colors */
    --s-text-primary: rgba(0, 0, 0, 0.95);
    --s-text-secondary: #86868b;
    --s-text-tertiary: #aeaeb2;
    --s-bg-primary: #ffffff;
    --s-bg-secondary: #f5f5f7;
    --s-bg-tertiary: #fafafa;
    --s-bg-page: #f5f5f7;
    --s-border: #e5e5ea;
    --s-border-light: #f2f2f7;
    --s-accent: #D4553A;
    --s-accent-hover: #B8442F;
    --s-blue: #D4553A;
    --s-blue-hover: #B8442F;
    --s-green: #34c759;
    --s-green-hover: #28a745;
    --s-red: #ff3b30;
    --s-orange: #ff9f0a;
    --s-purple: #5856d6;
    --s-indigo: #D4553A;
    --s-teal: #5ac8fa;
    --s-pink: #ff2d55;

    /* Shadows */
    --s-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --s-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --s-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --s-shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

    /* Radii */
    --s-radius-sm: 8px;
    --s-radius-md: 12px;
    --s-radius-lg: 16px;
    --s-radius-xl: 20px;
    --s-radius-full: 100px;

    /* Transitions */
    --s-transition: all 0.2s ease;
    --s-transition-slow: all 0.3s ease;
}

/* ---- Base ---- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--s-bg-page);
    color: var(--s-text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--s-text-primary);
    letter-spacing: -0.01em;
}

.text-muted { color: var(--s-text-secondary) !important; }
.small, small { font-size: 0.8125rem; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    background: rgba(0, 0, 0, 0.95) !important;
}

.sidebar .nav-link {
    font-size: 0.85rem;
    border-radius: var(--s-radius-sm);
    margin: 2px 10px;
    padding: 9px 14px !important;
    transition: var(--s-transition);
    color: rgba(255,255,255,0.55) !important;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff !important;
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-logo {
    transition: opacity 0.15s ease;
}

.sidebar-logo:hover {
    opacity: 0.85;
}

.sidebar-header {
    border-bottom-color: rgba(255,255,255,0.08) !important;
}

.sidebar-footer {
    border-top-color: rgba(255,255,255,0.08) !important;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--s-bg-page);
}

/* ---- Top Navbar ---- */
.navbar {
    background: rgba(255,255,255,0.8) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--s-border) !important;
}

.navbar h5 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-sm);
    transition: var(--s-transition);
    overflow: visible;
}

.card:hover {
    box-shadow: var(--s-shadow-md);
}

.card-header {
    border-radius: var(--s-radius-lg) var(--s-radius-lg) 0 0 !important;
    background: white !important;
    border-bottom: 1px solid var(--s-border-light) !important;
    padding: 16px 20px;
}

.card-header h5, .card-header h6 {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: white !important;
    border-top: 1px solid var(--s-border-light) !important;
    border-radius: 0 0 var(--s-radius-lg) var(--s-radius-lg) !important;
    padding: 12px 20px;
}

/* Cards that are links */
a .card, .card-link {
    cursor: pointer;
}

a .card:hover, .card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--s-shadow-md);
}

/* ---- Buttons ---- */
.btn {
    font-weight: 500;
    border-radius: var(--s-radius-md);
    padding: 8px 18px;
    font-size: 0.875rem;
    transition: var(--s-transition);
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--s-blue);
    border-color: var(--s-blue);
}

.btn-primary:hover {
    background: var(--s-blue-hover);
    border-color: var(--s-blue-hover);
}

.btn-success {
    background: var(--s-green);
    border-color: var(--s-green);
}

.btn-danger {
    background: var(--s-red);
    border-color: var(--s-red);
}

.btn-outline-primary {
    color: var(--s-blue);
    border-color: var(--s-blue);
    border-width: 1.5px;
}

.btn-outline-primary:hover {
    background: var(--s-blue);
    border-color: var(--s-blue);
}

.btn-outline-secondary {
    color: var(--s-text-secondary);
    border-color: var(--s-border);
    border-width: 1.5px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
    border-radius: var(--s-radius-sm);
}

/* Custom action buttons */
.btn-action {
    border-radius: var(--s-radius-md);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 8px 18px;
    border: none;
    transition: var(--s-transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-action:hover { transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }

.btn-action-primary { background: var(--s-blue); color: white; }
.btn-action-primary:hover { background: var(--s-blue-hover); color: white; }

.btn-action-green { background: var(--s-green); color: white; }
.btn-action-green:hover { background: var(--s-green-hover); color: white; }

.btn-action-light { background: var(--s-border-light); color: var(--s-text-primary); }
.btn-action-light:hover { background: var(--s-border); color: var(--s-text-primary); }

.btn-action-danger { background: var(--s-red); color: white; }
.btn-action-danger:hover { background: #e0342b; color: white; }

/* ---- Form Controls ---- */
.form-control, .form-select {
    border-radius: var(--s-radius-sm);
    border: 1.5px solid var(--s-border);
    font-size: 0.875rem;
    padding: 9px 14px;
    transition: var(--s-transition);
    color: var(--s-text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--s-blue);
    box-shadow: 0 0 0 3px rgba(212,85,58,0.15);
}

.form-control-sm, .form-select-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: var(--s-radius-sm);
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--s-text-secondary);
    margin-bottom: 6px;
}

.form-text {
    color: var(--s-text-tertiary);
    font-size: 0.78rem;
}

.form-check-input:checked {
    background-color: var(--s-blue);
    border-color: var(--s-blue);
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    border-radius: var(--s-radius-full);
}

/* ---- Status pills ---- */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--s-radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-pill-draft     { background: #f2f2f7; color: #8e8e93; }
.status-pill-active    { background: #e4f8ed; color: #248a3d; }
.status-pill-completed { background: #f5e6e3; color: #B8442F; }
.status-pill-archived  { background: #f2f2f7; color: #636366; }
.status-pill-planned   { background: #f2f2f7; color: #8e8e93; }
.status-pill-generated { background: #fde8e4; color: #D4553A; }
.status-pill-edited    { background: #fff8e1; color: #bf8211; }
.status-pill-changes_requested { background: #FEF3C7; color: #B45309; }
.status-pill-approved  { background: #e4f8ed; color: #248a3d; }
.status-pill-published { background: #f5e6e3; color: #B8442F; }
.status-pill-ready     { background: #e4f8ed; color: #248a3d; }
.status-pill-outline   { background: #fde8e4; color: #D4553A; }

/* ---- Dropdown menus ---- */
.dropdown-menu {
    border: none;
    border-radius: var(--s-radius-md);
    box-shadow: var(--s-shadow-lg);
    padding: 6px;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    border-radius: var(--s-radius-sm);
    font-size: 0.85rem;
    padding: 8px 14px;
    transition: var(--s-transition);
}

.dropdown-item:hover {
    background: var(--s-border-light);
}

.dropdown-item:active {
    background: var(--s-border);
}

.dropdown-divider {
    margin: 4px 0;
    border-color: var(--s-border-light);
}

/* ---- Alerts ---- */
.alert {
    border-radius: var(--s-radius-md);
    font-size: 0.875rem;
    border: none;
}

/* ---- Progress bars ---- */
.progress {
    border-radius: var(--s-radius-full);
    height: 6px;
    background: var(--s-border-light);
}

.progress-bar {
    border-radius: var(--s-radius-full);
}

/* ---- Tables ---- */
.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--s-text-secondary);
    border-bottom-width: 1px;
    border-color: var(--s-border-light);
    padding: 12px 16px;
}

.table td {
    font-size: 0.875rem;
    vertical-align: middle;
    border-color: var(--s-border-light);
    padding: 12px 16px;
}

/* ---- List groups ---- */
.list-group-item {
    border-color: var(--s-border-light);
    transition: var(--s-transition);
}

.list-group-item-action:hover {
    background: var(--s-bg-tertiary);
}

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

.empty-state i {
    font-size: 2.5rem;
    color: var(--s-text-tertiary);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state-card {
    border: 2px dashed var(--s-border);
    border-radius: var(--s-radius-xl);
    background: var(--s-bg-tertiary);
    text-align: center;
    padding: 60px 20px;
}

.empty-state-card i {
    font-size: 2.5rem;
    color: var(--s-text-tertiary);
}

/* ---- Page header pattern ---- */
.page-header {
    margin-bottom: 24px;
}

.page-header h1, .page-header .page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--s-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.page-header .page-subtitle {
    color: var(--s-text-secondary);
    font-size: 0.9rem;
    margin: 4px 0 0;
}

/* ---- Stat cards ---- */
.stat-card {
    border: none;
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-sm);
    background: white;
    overflow: hidden;
}

.stat-card .stat-item {
    text-align: center;
    padding: 20px 12px;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--s-text-primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    color: var(--s-text-secondary);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card .stat-divider {
    width: 1px;
    background: var(--s-border-light);
    align-self: stretch;
}

/* Mini stat cards (dashboard) */
.mini-stat {
    border-radius: var(--s-radius-lg);
    padding: 20px;
    background: white;
    box-shadow: var(--s-shadow-sm);
    transition: var(--s-transition);
}

.mini-stat:hover {
    box-shadow: var(--s-shadow-md);
    transform: translateY(-2px);
}

.mini-stat .mini-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--s-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.mini-stat .mini-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--s-text-primary);
}

.mini-stat .mini-stat-label {
    font-size: 0.78rem;
    color: var(--s-text-secondary);
    font-weight: 500;
}

/* ---- Filter bar ---- */
.filter-bar {
    background: white;
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-sm);
    padding: 14px 20px;
    margin-bottom: 20px;
}

.filter-bar .form-select-sm, .filter-bar .form-control-sm {
    border-radius: var(--s-radius-sm);
    font-size: 0.8125rem;
}

/* ---- Content cards (social, blog, editorial) ---- */
.content-card {
    border: none;
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-sm);
    transition: var(--s-transition);
    background: white;
    overflow: visible;
}

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

.content-card:has(.dropdown-menu.show) {
    z-index: 2;
}

.content-card .card-body {
    padding: 18px 20px;
}

/* ---- Channel icons ---- */
.channel-circle {
    width: 42px;
    height: 42px;
    border-radius: var(--s-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.channel-circle:hover {
    transform: scale(1.05);
}

/* Channel picker buttons */
.ch-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 6px;
    border: 2px solid transparent;
    border-radius: var(--s-radius-md);
    background: var(--s-bg-secondary);
    cursor: pointer;
    transition: var(--s-transition);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--s-text-tertiary);
    min-width: 52px;
    text-align: center;
}

.ch-btn i { font-size: 1.1rem; transition: color 0.2s ease; }

.ch-btn:hover {
    background: var(--s-border-light);
    color: #636366;
    transform: translateY(-1px);
}

.ch-btn.active {
    border-color: var(--ch-color);
    background: white;
    color: var(--ch-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ch-btn.active i { color: var(--ch-color); }

/* ---- Breadcrumb ---- */
.breadcrumb-back {
    text-decoration: none;
    color: var(--s-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--s-transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-back:hover {
    color: var(--s-blue);
}

.breadcrumb-back i {
    font-size: 0.7rem;
}

/* ---- Progress bar (editorial) ---- */
.progress-bar-ep {
    height: 5px;
    border-radius: var(--s-radius-full);
    background: var(--s-border-light);
    overflow: hidden;
    display: flex;
}

.progress-bar-ep > div {
    height: 100%;
    transition: width 0.5s ease;
}

/* ---- Date headers ---- */
.date-header {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--s-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 0;
}

.date-header .date-count {
    background: var(--s-border);
    color: #636366;
    padding: 2px 8px;
    border-radius: var(--s-radius-full);
    font-size: 0.7rem;
    font-weight: 700;
}

/* ---- Item content lines ---- */
.item-topic {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--s-text-primary);
    margin-bottom: 2px;
}

.item-meta {
    font-size: 0.78rem;
    color: var(--s-text-secondary);
}

.item-meta strong {
    color: #636366;
    font-weight: 600;
}

/* ---- Badge format ---- */
.badge-format {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--s-border-light);
    color: #636366;
}

/* ---- Edit form ---- */
.edit-form {
    background: var(--s-bg-tertiary);
    border-radius: var(--s-radius-md);
    padding: 20px;
    border: 1px solid var(--s-border-light);
}

.edit-form .form-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--s-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.edit-form .form-control {
    border-radius: 10px;
    border: 1px solid var(--s-border);
    font-size: 0.85rem;
}

.edit-form .form-control:focus {
    border-color: var(--s-blue);
    box-shadow: 0 0 0 3px rgba(212,85,58,0.15);
}

/* ---- Confirm modal ---- */
body.modal-open {
    overflow: hidden;
}

.modal-confirm .modal-content {
    border: none;
    border-radius: var(--s-radius-xl);
    box-shadow: var(--s-shadow-xl);
    background: #fff;
    animation: modalPop 0.18s ease-out;
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-confirm .modal-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--s-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.modal-confirm .modal-icon.icon-danger { background: #fee2e2; color: #ef4444; }
.modal-confirm .modal-icon.icon-success { background: #dcfce7; color: #22c55e; }
.modal-confirm .modal-icon.icon-warning { background: #fff8e1; color: #f59e0b; }

/* ---- Add form card ---- */
.add-form-card {
    border: none;
    border-radius: var(--s-radius-lg);
    background: var(--s-bg-secondary);
    border: 1px solid var(--s-border-light);
}

/* ---- Quick actions ---- */
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--s-radius-md);
    background: white;
    border: 1.5px solid var(--s-border);
    color: var(--s-text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--s-transition);
    white-space: nowrap;
}

.quick-action-btn:hover {
    border-color: var(--s-blue);
    color: var(--s-blue);
    background: #fdf0ed;
    transform: translateY(-1px);
}

.quick-action-btn i {
    font-size: 1rem;
    color: var(--s-blue);
}

/* ---- Media gallery ---- */
.media-card {
    border: none;
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-sm);
    overflow: hidden;
    transition: var(--s-transition);
}

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

.media-card .card-img-top {
    border-radius: var(--s-radius-lg) var(--s-radius-lg) 0 0;
}

/* ---- Calendar grid ---- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    min-height: 100px;
    background: white;
    border: 1px solid var(--s-border-light);
    border-radius: var(--s-radius-sm);
    padding: 8px;
    font-size: 0.8125rem;
    transition: var(--s-transition);
}

.calendar-day:hover {
    box-shadow: var(--s-shadow-sm);
}

.calendar-day-header {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--s-text-secondary);
    padding: 8px;
    text-align: center;
}

.calendar-item {
    cursor: pointer;
    transition: var(--s-transition);
    border: 1px solid transparent;
}

.calendar-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-color: var(--s-border-light);
}

/* ---- Loading spinner ---- */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ---- Wizard steps ---- */
.wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
}

.wizard-step {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--s-text-tertiary);
    border-bottom: 3px solid var(--s-border);
    transition: var(--s-transition);
}

.wizard-step.active {
    color: var(--s-blue);
    border-bottom-color: var(--s-blue);
}

.wizard-step.completed {
    color: var(--s-green);
    border-bottom-color: var(--s-green);
}

/* ---- Content editor ---- */
.content-preview {
    background: white;
    border: 1px solid var(--s-border-light);
    border-radius: var(--s-radius-md);
    padding: 24px;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ---- Trial / Upgrade banners ---- */
.trial-banner {
    border-radius: var(--s-radius-lg);
    padding: 20px 24px;
    border: none;
}

.trial-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Utility classes ---- */
.cursor-pointer { cursor: pointer; }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Gradient backgrounds */
.bg-gradient-blue { background: linear-gradient(135deg, var(--s-accent), #E8836A); }
.bg-gradient-green { background: linear-gradient(135deg, #34c759, #30d158); }
.bg-gradient-purple { background: linear-gradient(135deg, var(--s-accent), #E8836A); }
.bg-gradient-red { background: linear-gradient(135deg, var(--s-red), #ff6961); }
.bg-gradient-orange { background: linear-gradient(135deg, #ff9f0a, #ffcc00); }

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

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

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

    .page-header h1, .page-header .page-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 767.98px) {
    .mini-stat .mini-stat-value {
        font-size: 1.25rem;
    }

    .stat-card .stat-number {
        font-size: 1.3rem;
    }

    .quick-action-btn {
        font-size: 0.8rem;
        padding: 8px 14px;
    }
}

/* ---- Badge status classes (legacy, mapped to pills) ---- */
.badge-status-draft { background-color: #f2f2f7; color: #636366; }
.badge-status-ready { background-color: #e4f8ed; color: #248a3d; }
.badge-status-published { background-color: #f5e6e3; color: #B8442F; }
.badge-status-planned { background-color: #fff8e1; color: #bf8211; }

/* ---- Generation modal (create forms) ---- */
.gen-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.gen-modal-backdrop.active { display: flex; }

.gen-modal-card {
    background: white;
    border-radius: var(--s-radius-xl);
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--s-shadow-xl);
    animation: genModalIn 0.4s cubic-bezier(.16,1,.3,1);
}

@keyframes genModalIn {
    from { opacity: 0; transform: translateY(30px) scale(.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gen-orb { width: 80px; height: 80px; margin: 0 auto 1.5rem; position: relative; }
.gen-orb-ring { position: absolute; inset: 0; border: 3px solid transparent; border-top-color: var(--s-indigo); border-radius: 50%; animation: genSpin 1.2s linear infinite; }
.gen-orb-ring:nth-child(2) { inset: 8px; border-top-color: #E8836A; animation-duration: 1.6s; animation-direction: reverse; }
.gen-orb-ring:nth-child(3) { inset: 16px; border-top-color: #F0A999; animation-duration: 2s; }
.gen-orb-center { position: absolute; inset: 24px; background: linear-gradient(135deg, var(--s-accent), #E8836A); border-radius: 50%; display: flex; align-items: center; justify-content: center; animation: genPulse 2s ease-in-out infinite; }
.gen-orb-center i { color: white; font-size: 1rem; }

@keyframes genSpin { to { transform: rotate(360deg); } }
@keyframes genPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: .85; } }

.gen-modal-title { font-weight: 700; font-size: 1.25rem; color: var(--s-text-primary); margin-bottom: 8px; }
.gen-modal-desc { color: var(--s-text-secondary); font-size: 0.9rem; line-height: 1.5; margin-bottom: 24px; }

.gen-steps { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.gen-step { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--s-text-tertiary); transition: color 0.3s; }
.gen-step.active { color: var(--s-indigo); font-weight: 600; }
.gen-step.done { color: var(--s-green); }
.gen-step-icon { width: 24px; height: 24px; border-radius: 50%; background: var(--s-border-light); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; flex-shrink: 0; transition: var(--s-transition-slow); }
.gen-step.active .gen-step-icon { background: #fde8e4; color: var(--s-accent); }
.gen-step.done .gen-step-icon { background: #d1fae5; color: var(--s-green); }

/* ---- Flatpickr overrides ---- */
.flatpickr-input-wrapper { position: relative; }
.flatpickr-input-wrapper .form-control { padding-left: 2.5rem; cursor: pointer; background-color: #fff !important; }
.flatpickr-input-wrapper .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--s-indigo); font-size: 1.1rem; pointer-events: none; z-index: 4; }

/* ---- Tour guidato ---- */
.segno-tour-backdrop { position: fixed; inset: 0; z-index: 2000; }
.segno-tour-backdrop.segno-tour-dim { background: rgba(20, 18, 16, 0.55); }
.segno-tour-highlight {
    position: absolute; z-index: 2001; pointer-events: none;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(20, 18, 16, 0.55), 0 0 0 3px var(--s-accent, #D4553A);
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.segno-tour-tooltip {
    position: absolute; z-index: 2002;
    width: min(340px, calc(100vw - 24px));
    background: #fff; border-radius: 12px; padding: 16px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    font-size: 0.875rem; color: var(--s-text-primary);
}
.segno-tour-tooltip.segno-tour-centered {
    position: fixed; top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%);
}
.segno-tour-close {
    position: absolute; top: 8px; right: 12px;
    background: none; border: none; font-size: 1.25rem; line-height: 1;
    color: var(--s-text-tertiary); cursor: pointer; padding: 2px;
}
.segno-tour-close:hover { color: var(--s-text-primary); }
.segno-tour-step-count { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; color: var(--s-text-tertiary); margin-bottom: 4px; text-transform: uppercase; }
.segno-tour-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.segno-tour-body { color: var(--s-text-secondary); line-height: 1.5; margin-bottom: 14px; }
.segno-tour-actions { display: flex; align-items: center; gap: 8px; }
.segno-tour-spacer { flex: 1; }
.segno-tour-btn {
    border: none; border-radius: 8px; padding: 6px 14px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.segno-tour-btn-light { background: var(--s-bg-secondary, #f4f2ef); color: var(--s-text-secondary); }
.segno-tour-btn-light:hover { color: var(--s-text-primary); }
.segno-tour-btn-primary { background: var(--s-accent, #D4553A); color: #fff; }
.segno-tour-btn-primary:hover { filter: brightness(0.95); }
