/* ============================================================
   Reldio CMS — Redesigned based on Finzo Finance UI Kit
   Primary: #22C55E (green) | Dark Sidebar | Clean Cards
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Urbanist:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ────────────────────────────────────────── */
:root {
    --primary:        #22C55E;
    --primary-dark:   #16A34A;
    --primary-light:  #DCFCE7;
    --primary-glow:   rgba(34,197,94,0.18);

    --sidebar-width:  260px;
    --sidebar-bg:     #0D1117;
    --sidebar-border: #1E2832;
    --sidebar-text:   #8B949E;
    --sidebar-hover:  #161B22;
    --sidebar-active: #1A2D1E;

    --topbar-height:  64px;
    --topbar-bg:      #ffffff;

    --body-bg:        #F0F4F8;
    --card-bg:        #ffffff;
    --card-border:    #E8EDF2;
    --card-radius:    14px;
    --card-shadow:    0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.10), 0 8px 32px rgba(0,0,0,0.06);

    --text-primary:   #0F172A;
    --text-secondary: #64748B;
    --text-muted:     #94A3B8;

    --border-color:   #E2E8F0;
    --input-bg:       #F8FAFC;
    --input-border:   #CBD5E1;
    --input-focus:    #22C55E;

    --success:  #22C55E;
    --warning:  #F59E0B;
    --danger:   #EF4444;
    --info:     #3B82F6;

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

    --transition: 0.2s ease;
    --transition-slow: 0.35s cubic-bezier(.4,0,.2,1);
}

/* ─── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    font-size: 0.9rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

h1,h2,h3,h4,h5,h6 { font-family: 'Urbanist', 'DM Sans', sans-serif; font-weight: 700; letter-spacing: -0.02em; }

/* ─── Material Symbols (Google Icons) ─────────────────────── */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    font-size: 1.2em;
    vertical-align: -0.2em;
    line-height: 1;
    display: inline-block;
}

.sidebar-nav li a .material-symbols-outlined {
    font-size: 1.15rem;
    vertical-align: -0.15em;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    transition: transform var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

/* Brand */
.sidebar-header {
    padding: 1.4rem 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-brand-sub {
    color: var(--sidebar-text);
    font-size: 0.7rem;
    font-weight: 400;
}

/* Nav */
.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-section {
    padding: 1.2rem 1.5rem 0.4rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3D4F60;
    font-weight: 600;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    position: relative;
    margin: 0 0.5rem;
    border-radius: var(--radius-md);
}

.sidebar-nav li a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: color var(--transition);
}

.sidebar-nav li a:hover {
    color: #FFFFFF;
    background: var(--sidebar-hover);
}

.sidebar-nav li a.active {
    color: var(--primary);
    background: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-nav li a.active i {
    color: var(--primary);
}

.sidebar-nav li a.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

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

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #16A34A);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--sidebar-text);
    font-size: 0.7rem;
}

/* ─── Main Content ─────────────────────────────────────────── */
#main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-slow);
    min-height: 100vh;
}

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

/* ─── Top Navbar ───────────────────────────────────────────── */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.75rem;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 var(--border-color);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Toggle button */
#sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

#sidebar-toggle:hover {
    background: var(--body-bg);
    color: var(--text-primary);
}

/* Page breadcrumb in navbar */
.topbar-page-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Icon buttons in topbar */
.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
    position: relative;
}

.topbar-icon-btn:hover {
    background: var(--body-bg);
    color: var(--text-primary);
}

.topbar-icon-btn i { font-size: 1.1rem; }

/* Notification badge — red pill with count number inside */
.notif-badge-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: 9px;          /* pill shape — keeps circle for 1 digit */
    border: 2px solid #fff;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;        /* let click pass through to button */
}

/* User pill */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-user-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #16A34A);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.topbar-user-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ─── Content Wrapper ──────────────────────────────────────── */
.content-wrapper {
    padding: 1.75rem;
}

/* ─── Page Header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h4 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    overflow: hidden;
}

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

.card-header {
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.card-body { padding: 1.25rem; }
.card-footer {
    background: var(--card-bg) !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 0.875rem 1.25rem;
}

/* ─── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.06;
    background: currentColor;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

/* Stat icon color variants */
.stat-icon-green  { background: #DCFCE7; color: #16A34A; }
.stat-icon-blue   { background: #DBEAFE; color: #2563EB; }
.stat-icon-amber  { background: #FEF3C7; color: #D97706; }
.stat-icon-violet { background: #EDE9FE; color: #7C3AED; }
.stat-icon-rose   { background: #FFE4E6; color: #E11D48; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    font-weight: 600;
    font-size: 0.83rem;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-outline-success { color: var(--success); border-color: var(--success); }
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-outline-danger { color: var(--danger); border-color: #FECACA; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-outline-info { color: var(--info); border-color: #BFDBFE; }
.btn-outline-info:hover { background: var(--info); border-color: var(--info); color: #fff; }

.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border-color); }
.btn-outline-secondary:hover { background: var(--body-bg); color: var(--text-primary); border-color: #94A3B8; }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; border-radius: var(--radius-md); }

/* ─── Forms ────────────────────────────────────────────────── */
.form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    transition: all var(--transition);
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder { color: var(--text-muted); }

.input-group-text {
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.3em 0.65em;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

.badge.bg-success  { background: #DCFCE7 !important; color: #16A34A !important; }
.badge.bg-primary  { background: #DBEAFE !important; color: #2563EB !important; }
.badge.bg-danger   { background: #FFE4E6 !important; color: #E11D48 !important; }
.badge.bg-warning  { background: #FEF3C7 !important; color: #D97706 !important; }
.badge.bg-info     { background: #E0F2FE !important; color: #0284C7 !important; }
.badge.bg-secondary{ background: #F1F5F9 !important; color: #475569 !important; }
.badge.bg-light    { background: #F8FAFC !important; color: #64748B !important; border: 1px solid var(--border-color); }

/* ─── Tables ───────────────────────────────────────────────── */
.table {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
}

.table > thead > tr > th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.875rem 1.25rem;
    background: #FAFBFC;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 0.9rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
    color: var(--text-primary);
}

.table-hover tbody tr:hover { background-color: #FAFBFE !important; }

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

/* ─── Alerts ───────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.875rem 1rem;
}

.alert-success  { background: #DCFCE7; color: #166534; }
.alert-danger   { background: #FFE4E6; color: #9F1239; }
.alert-warning  { background: #FEF3C7; color: #92400E; }
.alert-info     { background: #E0F2FE; color: #075985; }

/* ─── Notification Dropdown ────────────────────────────────── */
.notification-dropdown {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
    padding: 0 !important;
    overflow: hidden;
}

.notification-dropdown .notif-item {
    padding: 0.875rem 1.1rem;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background var(--transition);
}

.notification-dropdown .notif-item:last-child { border-bottom: none; }

.notification-dropdown .notif-item:hover { background: #F8FAFC; }

.notification-dropdown .notif-item.unread {
    background: #F0FDF4;
    border-left: 3px solid var(--primary);
}

.notification-dropdown .notif-item .notif-title {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--text-primary);
}

.notification-dropdown .notif-item .notif-msg {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.notification-dropdown .notif-item .notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── Dropdown ─────────────────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--card-radius) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10) !important;
    padding: 0.4rem !important;
    font-size: 0.875rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* ─── Calendar ─────────────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.calendar-header-cell {
    background: var(--sidebar-bg);
    color: #8B949E;
    text-align: center;
    padding: 0.65rem 0.5rem;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.calendar-cell {
    background: var(--card-bg);
    min-height: 100px;
    padding: 0.5rem;
    font-size: 0.82rem;
    transition: background var(--transition), box-shadow var(--transition);
}

.calendar-cell:not(.other-month) {
    cursor: pointer;
}

.calendar-cell:not(.other-month):hover {
    background: #F5F7FF;
    box-shadow: inset 0 0 0 2px rgba(34,197,94,0.25);
}

.calendar-cell.today:hover {
    background: #E8FFF0;
}

.calendar-cell.today { background: #F0FDF4; }

.calendar-cell.today .day-number {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.calendar-cell.other-month { background: #FAFBFC; }
.calendar-cell.other-month .day-number { color: var(--text-muted); }

.calendar-cell .day-number {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.calendar-cell .post-item {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* ─── Media Grid ───────────────────────────────────────────── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.875rem;
}

.media-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition);
}

.media-item:hover { box-shadow: var(--card-shadow-hover); }

.media-item img,
.media-item video {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.media-item .media-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 3px;
}

.media-feat-btn {
    padding: 3px 5px !important;
    line-height: 1 !important;
}

.media-item.is-featured {
    border-color: #F59E0B;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.40);
}

.media-item.is-featured::after {
    content: 'Principale';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #F59E0B;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    text-align: center;
    padding: 3px 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ─── Rich Text Editor ─────────────────────────────────────── */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--input-bg);
}

.editor-toolbar button {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.82rem;
    transition: all var(--transition);
}

.editor-toolbar button:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.editor-heading-select {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    min-width: 118px;
    transition: all var(--transition);
}
.editor-heading-select:hover {
    background: var(--border-color);
    color: var(--text-primary);
}
.editor-heading-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--border-color);
    color: var(--text-primary);
}
.editor-heading-select option {
    font-weight: 500;
    background: var(--surface);
    color: var(--text-primary);
}

.editor-lang-btn {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.editor-lang-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}
.editor-lang-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.editor-content {
    min-height: 280px;
    padding: 1rem;
    outline: none;
    font-size: 0.9rem;
    line-height: 1.7;
}

.editor-content:focus { box-shadow: none; }

/* ─── Login Page (split layout) ────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Left panel — green gradient with marketing copy */
.login-hero {
    flex: 1;
    background: linear-gradient(160deg, #15803D 0%, #16A34A 40%, #22C55E 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 3.5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.login-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
    pointer-events: none;
}

.login-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.login-hero-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.login-hero-logo {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.login-hero-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.login-hero-sub {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.login-hero-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-hero-features {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.login-hero-features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    font-size: 0.88rem;
    font-weight: 500;
}

.login-hero-features li i {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* Right panel — white form */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 3rem;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.03em;
}

.login-sub {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 2rem;
}

.login-card .form-label {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.login-card .form-control {
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
}

.login-card .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-primary);
}

.login-card .form-control::placeholder { color: var(--text-muted); }

.login-card .input-group-text {
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    color: var(--text-muted);
}

.login-card .btn-primary {
    background: var(--primary);
    border: none;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    letter-spacing: 0.01em;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.login-card .btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 24px rgba(34,197,94,0.3);
    transform: translateY(-1px);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-footer-link {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.login-footer-link a {
    color: var(--primary);
    font-weight: 600;
}

/* Alert inside login */
.login-card .alert {
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    border: none;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .login-page { flex-direction: column; }
    .login-hero {
        padding: 2rem 1.5rem;
        min-height: auto;
    }
    .login-hero h1 { font-size: 1.5rem; }
    .login-hero-desc { font-size: 0.82rem; margin-bottom: 1rem; }
    .login-hero-features li { font-size: 0.82rem; padding: 0.35rem 0; }
    .login-form-panel { padding: 2rem 1.5rem; min-height: auto; }
}

/* ─── Quick Actions Grid (Dashboard) ──────────────────────── */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.quick-action-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px var(--primary-glow);
    color: var(--primary);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ─── Company profile status pills ────────────────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.published  { background: #DCFCE7; color: #16A34A; }
.status-pill.draft      { background: #F1F5F9; color: #64748B; }
.status-pill.approved   { background: #DBEAFE; color: #2563EB; }
.status-pill.rejected   { background: #FFE4E6; color: #E11D48; }

/* ─── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.empty-state h5 { color: var(--text-primary); font-weight: 700; margin-bottom: 0.5rem; }
.empty-state p  { color: var(--text-secondary); font-size: 0.875rem; max-width: 320px; margin: 0 auto 1.5rem; }

/* ─── Misc Utilities ───────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }

.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }

.rounded-xl { border-radius: var(--card-radius) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
        box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

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

    .content-wrapper {
        padding: 1.25rem;
    }

    .top-navbar {
        padding: 0 1.25rem;
    }
}

@media (max-width: 576px) {
    .stat-card .stat-value { font-size: 1.6rem; }
    .content-wrapper { padding: 1rem; }
    .login-card { padding: 1.75rem 1.25rem; }
}

/* ─── AI Generation Modal ──────────────────────────────────── */
#aiModal .modal-content {
    border-radius: var(--card-radius);
    border: 1px solid var(--card-border);
    box-shadow: 0 24px 64px rgba(0,0,0,0.15);
}

#aiModal .modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

#aiModal .modal-title {
    font-weight: 700;
    font-size: 1rem;
}

#aiModal .modal-title i {
    color: var(--primary);
}

#aiModal .modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 0.875rem 1.25rem;
}

#ai-result {
    font-size: 0.875rem;
    line-height: 1.7;
    background: #FAFBFC;
    border-color: var(--border-color) !important;
}

#ai-result h2, #ai-result h3 {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

#ai-result p {
    margin-bottom: 0.5rem;
}

#ai-result ul, #ai-result ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ─── Sidebar overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ─── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.content-wrapper > * {
    animation: fadeInUp 0.3s ease both;
}

.content-wrapper > *:nth-child(2) { animation-delay: 0.05s; }
.content-wrapper > *:nth-child(3) { animation-delay: 0.10s; }
.content-wrapper > *:nth-child(4) { animation-delay: 0.15s; }

/* ─── Company selector (topbar) ─────────────────────────────── */
.company-selector {
    min-width: 200px;
    font-size: 0.82rem;
}

/* ─── Pagination ───────────────────────────────────────────── */
.pagination .page-link {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    margin: 0 2px;
    padding: 0.4rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.pagination .page-link:hover {
    background: var(--body-bg);
    border-color: var(--primary);
    color: var(--primary);
}
