/* ============================================================
   AEROTHANE APPLICATIONS — ADMIN PANEL STYLESHEET
   admin/style.css
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES
   ------------------------------------------------------------ */
:root {
    --navy: #111111;
    --navy-dark: #0a0a0a;
    --navy-light: #2a2a2a;
    --blue: #cc0000;
    --steel: #ee3333;
    --orange: #cc0000;
    --amber: #ff4444;
    --white: #ffffff;
    --light-grey: #f5f7fa;
    --mid-grey: #e2e8f0;
    --dark-text: #111111;
    --mid-text: #4a5568;
    --light-text: #718096;
    --border: #e2e8f0;
    --danger: #e53e3e;
    --danger-light: #fff5f5;
    --success: #38a169;
    --success-light: #f0fff4;
    --warning: #d69e2e;
    --warning-light: #fffff0;
    --info: #3182ce;
    --info-light: #ebf8ff;

    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;

    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.14);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.25s ease;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;

    --grad-primary: linear-gradient(135deg, #cc0000, #ee3333);
    --grad-secondary: linear-gradient(135deg, #222222, #444444);
    --grad-navy: linear-gradient(135deg, #111111, #2a2a2a);
    --grad-success: linear-gradient(135deg, #38a169, #68d391);
    --grad-danger: linear-gradient(135deg, #e53e3e, #fc8181);
    --grad-warning: linear-gradient(135deg, #d69e2e, #f6e05e);
    --grad-accent: linear-gradient(90deg, #cc0000, #ff4444, #111111);
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--light-grey);
    color: var(--mid-text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--orange);
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button,
input,
select,
textarea {
    font-family: var(--font);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark-text);
    font-weight: 700;
    line-height: 1.3;
}

/* ------------------------------------------------------------
   3. LAYOUT STRUCTURE
   ------------------------------------------------------------ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ------------------------------------------------------------
   4. SIDEBAR
   ------------------------------------------------------------ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: width 0.3s ease;
    overflow: hidden;
}

/* Sidebar top gradient accent */
.sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-accent);
    flex-shrink: 0;
}

/* Sidebar Brand */
.sidebar-brand {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

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

.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.brand-sub {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--orange);
    background: rgba(204, 0, 0, 0.12);
    border: 1px solid rgba(204, 0, 0, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 14px 24px 6px;
    white-space: nowrap;
}

.sidebar-nav ul {
    padding: 0 12px;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--white);
}

.sidebar-nav li a.active {
    background: rgba(204, 0, 0, 0.15);
    color: var(--white);
}

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

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--orange);
    color: var(--white);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.sidebar-footer a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-footer a.logout-link:hover {
    background: rgba(229, 62, 62, 0.15);
    color: #fc8181;
}

/* ------------------------------------------------------------
   5. MAIN CONTENT AREA
   ------------------------------------------------------------ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ------------------------------------------------------------
   6. TOP BAR
   ------------------------------------------------------------ */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left h1 {
    font-size: 1.15rem;
    color: var(--dark-text);
    font-weight: 700;
}

.topbar-breadcrumb {
    font-size: 0.8rem;
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-breadcrumb a {
    color: var(--light-text);
}

.topbar-breadcrumb a:hover {
    color: var(--blue);
}

.topbar-breadcrumb .sep {
    color: var(--mid-grey);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.topbar-user:hover {
    background: var(--light-grey);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--grad-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.user-info .user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark-text);
    display: block;
    line-height: 1.2;
}

.user-info .user-role {
    font-size: 0.72rem;
    color: var(--light-text);
    display: block;
}

.topbar-btn {
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-btn.view-site {
    background: var(--light-grey);
    color: var(--mid-text);
    border: 1px solid var(--border);
}

.topbar-btn.view-site:hover {
    background: var(--mid-grey);
    color: var(--dark-text);
}

/* ------------------------------------------------------------
   7. PAGE CONTENT WRAPPER
   ------------------------------------------------------------ */
.page-content {
    padding: 28px;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left h2 {
    font-size: 1.5rem;
    color: var(--dark-text);
    margin-bottom: 4px;
}

.page-header-left p {
    font-size: 0.88rem;
    color: var(--light-text);
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   8. STATS CARDS
   ------------------------------------------------------------ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
}

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

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.orange::before {
    background: var(--grad-primary);
}
.stat-card.blue::before {
    background: var(--grad-secondary);
}
.stat-card.green::before {
    background: var(--grad-success);
}
.stat-card.red::before {
    background: var(--grad-danger);
}
.stat-card.navy::before {
    background: var(--grad-navy);
}
.stat-card.warning::before {
    background: var(--grad-warning);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--light-text);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-card.orange .stat-card-icon {
    background: rgba(204, 0, 0, 0.08);
}
.stat-card.blue .stat-card-icon {
    background: rgba(204, 0, 0, 0.08);
}
.stat-card.green .stat-card-icon {
    background: rgba(56, 161, 105, 0.1);
}
.stat-card.red .stat-card-icon {
    background: rgba(229, 62, 62, 0.1);
}
.stat-card.navy .stat-card-icon {
    background: rgba(26, 46, 74, 0.08);
}
.stat-card.warning .stat-card-icon {
    background: rgba(214, 158, 46, 0.1);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-text);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card-label {
    font-size: 0.82rem;
    color: var(--light-text);
}

.stat-card-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-trend {
    font-weight: 600;
    font-size: 0.78rem;
}

.stat-trend.up {
    color: var(--success);
}
.stat-trend.down {
    color: var(--danger);
}
.stat-trend.neutral {
    color: var(--light-text);
}

/* ------------------------------------------------------------
   9. CARD / PANEL COMPONENT
   ------------------------------------------------------------ */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.card-subtitle {
    font-size: 0.78rem;
    color: var(--light-text);
    margin-top: 2px;
}

.card-body {
    padding: 24px;
}

.card-body.no-padding {
    padding: 0;
}

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--light-grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--light-text);
}

/* Card grid layout */
.cards-grid {
    display: grid;
    gap: 24px;
}

.cards-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.cards-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ------------------------------------------------------------
   10. TABLES
   ------------------------------------------------------------ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead {
    background: var(--light-grey);
    border-bottom: 2px solid var(--border);
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--light-text);
    white-space: nowrap;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    color: var(--dark-text);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

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

.data-table tbody tr:hover {
    background: rgba(204, 0, 0, 0.03);
}

.data-table td {
    padding: 13px 16px;
    vertical-align: middle;
    color: var(--mid-text);
}

.data-table td.font-medium {
    font-weight: 600;
    color: var(--dark-text);
}

.data-table td .cell-sub {
    font-size: 0.78rem;
    color: var(--light-text);
    margin-top: 2px;
}

/* Table action buttons */
.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.action-btn.edit {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(49, 130, 206, 0.2);
}

.action-btn.edit:hover {
    background: var(--info);
    color: var(--white);
    border-color: var(--info);
}

.action-btn.delete {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(229, 62, 62, 0.2);
}

.action-btn.delete:hover {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.action-btn.view {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(56, 161, 105, 0.2);
}

.action-btn.view:hover {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.action-btn.mark-read {
    background: var(--warning-light);
    color: var(--warning);
    border-color: rgba(214, 158, 46, 0.2);
}

.action-btn.mark-read:hover {
    background: var(--warning);
    color: var(--white);
    border-color: var(--warning);
}

/* Empty table state */
.table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--light-text);
}

.table-empty .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.table-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ------------------------------------------------------------
   11. BADGES / STATUS PILLS
   ------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}
.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}
.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}
.badge-info {
    background: var(--info-light);
    color: var(--info);
}
.badge-orange {
    background: rgba(204, 0, 0, 0.08);
    color: var(--orange);
}
.badge-grey {
    background: var(--light-grey);
    color: var(--light-text);
    border: 1px solid var(--border);
}
.badge-navy {
    background: rgba(26, 46, 74, 0.08);
    color: var(--navy);
}

.badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

/* ------------------------------------------------------------
   12. FORMS
   ------------------------------------------------------------ */
.form-section {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.form-section-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--light-grey);
}

.form-section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-body {
    padding: 24px;
}

.form-grid {
    display: grid;
    gap: 20px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dark-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label .required {
    color: var(--danger);
    font-size: 0.85em;
}

.form-label .hint {
    font-weight: 400;
    color: var(--light-text);
    font-size: 0.78rem;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--dark-text);
    background: var(--white);
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.08);
}

.form-control:disabled {
    background: var(--light-grey);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-control.success {
    border-color: var(--success);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--light-text);
    margin-top: 2px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 2px;
}

/* Toggle / Checkbox */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--mid-grey);
    border-radius: 22px;
    transition: 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--success);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--dark-text);
}

/* Form actions bar */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    background: var(--light-grey);
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   13. BUTTONS
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font);
    line-height: 1.4;
}

.btn:focus-visible {
    outline: 3px solid rgba(204, 0, 0, 0.3);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--grad-primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(204, 0, 0, 0.35);
    transform: translateY(-1px);
    color: var(--white);
}

.btn-secondary {
    background: var(--grad-secondary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(204, 0, 0, 0.2);
}

.btn-secondary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(204, 0, 0, 0.28);
    transform: translateY(-1px);
    color: var(--white);
}

.btn-success {
    background: var(--grad-success);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.25);
}

.btn-success:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
    color: var(--white);
}

.btn-outline {
    background: var(--white);
    color: var(--mid-text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--light-grey);
    color: var(--dark-text);
    border-color: var(--mid-grey);
}

.btn-ghost {
    background: transparent;
    color: var(--mid-text);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--light-grey);
    color: var(--dark-text);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 0.95rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn[disabled],
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
}

/* Button icon */
.btn-icon {
    font-style: normal;
}

/* ------------------------------------------------------------
   14. ALERT / FLASH MESSAGES
   ------------------------------------------------------------ */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: var(--success-light);
    color: #276749;
    border-color: #c6f6d5;
}

.alert-danger {
    background: var(--danger-light);
    color: #9b2c2c;
    border-color: #fed7d7;
}

.alert-warning {
    background: var(--warning-light);
    color: #744210;
    border-color: #fefcbf;
}

.alert-info {
    background: var(--info-light);
    color: #2a4365;
    border-color: #bee3f8;
}

.alert-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 1rem;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.alert-dismiss:hover {
    opacity: 1;
}

/* ------------------------------------------------------------
   15. QUICK ACTION CARDS (dashboard)
   ------------------------------------------------------------ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.quick-action-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.quick-action-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(204, 0, 0, 0.1);
}

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

.qa-orange {
    background: rgba(204, 0, 0, 0.08);
}
.qa-blue {
    background: rgba(204, 0, 0, 0.08);
}
.qa-green {
    background: rgba(56, 161, 105, 0.1);
}
.qa-purple {
    background: rgba(128, 90, 213, 0.1);
}
.qa-red {
    background: rgba(229, 62, 62, 0.1);
}
.qa-navy {
    background: rgba(26, 46, 74, 0.07);
}

.qa-text .qa-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark-text);
    display: block;
    margin-bottom: 2px;
}

.qa-text .qa-desc {
    font-size: 0.77rem;
    color: var(--light-text);
}

/* ------------------------------------------------------------
   16. MESSAGES TABLE — SPECIFIC STYLES
   ------------------------------------------------------------ */
.message-preview {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--mid-text);
}

.message-row-unread td {
    font-weight: 600;
    color: var(--dark-text);
}

.message-row-unread td .cell-sub {
    font-weight: 400;
}

/* ------------------------------------------------------------
   17. SEARCH / FILTER BAR
   ------------------------------------------------------------ */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.table-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--light-text);
    pointer-events: none;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    color: var(--dark-text);
    background: var(--light-grey);
    transition: var(--transition);
}

.table-search input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.07);
}

.table-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-filter-select {
    padding: 7px 28px 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--mid-text);
    background: var(--light-grey);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.table-filter-select:focus {
    outline: none;
    border-color: var(--blue);
}

.table-count {
    font-size: 0.8rem;
    color: var(--light-text);
    white-space: nowrap;
}

/* ------------------------------------------------------------
   18. PAGINATION
   ------------------------------------------------------------ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--light-text);
}

.pagination-btns {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--mid-text);
    transition: var(--transition);
    text-decoration: none;
}

.page-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--info-light);
}

.page-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ------------------------------------------------------------
   19. LOGIN PAGE
   ------------------------------------------------------------ */
body.login-page {
    background: var(--grad-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-card-header {
    background: var(--grad-primary);
    padding: 32px 36px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card-header::before {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.login-card-header::after {
    content: "";
    position: absolute;
    left: -20px;
    bottom: -20px;
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.login-logo {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 4px;
    backdrop-filter: blur(4px);
}

.login-logo-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.3px;
}

.login-logo-sub {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-card-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.login-card-body {
    padding: 32px 36px;
}

.login-card-body .form-group {
    margin-bottom: 18px;
}

.login-card-body .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 6px;
    display: block;
}

.login-card-body .form-control {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--dark-text);
    transition: var(--transition);
}

.login-card-body .form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.08);
    outline: none;
}

.login-submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--grad-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

.login-submit-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(204, 0, 0, 0.35);
}

.login-back-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: 0.82rem;
    color: var(--light-text);
}

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

.login-error {
    background: var(--danger-light);
    color: #9b2c2c;
    border: 1px solid #fed7d7;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-security-note {
    text-align: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 0.76rem;
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ------------------------------------------------------------
   20. SETUP PAGE STYLES
   ------------------------------------------------------------ */
.setup-wrapper {
    min-height: 100vh;
    background: var(--light-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.setup-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 44px;
    max-width: 700px;
    width: 100%;
}

.setup-header {
    text-align: center;
    margin-bottom: 32px;
}

.setup-header h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.setup-header p {
    color: var(--light-text);
    font-size: 0.92rem;
}

.setup-log {
    background: var(--navy-dark);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 20px 0;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
}

.setup-log .log-success {
    color: #68d391;
}
.setup-log .log-error {
    color: #fc8181;
}
.setup-log .log-info {
    color: #90cdf4;
}
.setup-log .log-warning {
    color: #f6e05e;
}

.setup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ------------------------------------------------------------
   21. SETTINGS PAGE
   ------------------------------------------------------------ */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.settings-tab {
    padding: 10px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--mid-text);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font);
}

.settings-tab:hover {
    color: var(--blue);
}

.settings-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

/* ------------------------------------------------------------
   22. DASHBOARD RECENT ACTIVITY
   ------------------------------------------------------------ */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.activity-item:last-child {
    border-bottom: none;
}
.activity-item:hover {
    background: var(--light-grey);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
    margin-top: 6px;
}

.activity-dot.blue {
    background: var(--blue);
}
.activity-dot.green {
    background: var(--success);
}
.activity-dot.red {
    background: var(--danger);
}
.activity-dot.orange {
    background: var(--orange);
}

.activity-content {
    flex: 1;
}

.activity-content p {
    font-size: 0.87rem;
    color: var(--dark-text);
    font-weight: 500;
    margin-bottom: 2px;
}

.activity-content span {
    font-size: 0.77rem;
    color: var(--light-text);
}

/* ------------------------------------------------------------
   23. MESSAGE DETAIL VIEW
   ------------------------------------------------------------ */
.message-detail-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.message-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--light-grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.message-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}

.message-meta-item {
    background: var(--white);
    padding: 14px 20px;
}

.message-meta-item label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--light-text);
    margin-bottom: 4px;
}

.message-meta-item p {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-text);
    margin: 0;
}

.message-body-content {
    padding: 24px;
    font-size: 0.92rem;
    color: var(--mid-text);
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ------------------------------------------------------------
   24. LOADING / SPINNER
   ------------------------------------------------------------ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.spinner-dark {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--blue);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

/* ------------------------------------------------------------
   25. CONFIRM DIALOG
   ------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 40, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.visible {
    display: flex;
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1rem;
    color: var(--dark-text);
}

.modal-body {
    padding: 20px 24px;
    font-size: 0.9rem;
    color: var(--mid-text);
    line-height: 1.65;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--light-grey);
}

/* ------------------------------------------------------------
   26. MISC UTILITIES
   ------------------------------------------------------------ */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.text-muted {
    color: var(--light-text);
}
.text-danger {
    color: var(--danger);
}
.text-success {
    color: var(--success);
}
.text-warning {
    color: var(--warning);
}
.text-info {
    color: var(--info);
}
.text-orange {
    color: var(--orange);
}

.fw-bold {
    font-weight: 700;
}
.fw-medium {
    font-weight: 600;
}
.fw-normal {
    font-weight: 400;
}

.d-flex {
    display: flex;
}
.align-center {
    align-items: center;
}
.gap-8 {
    gap: 8px;
}
.gap-12 {
    gap: 12px;
}
.gap-16 {
    gap: 16px;
}

.mt-8 {
    margin-top: 8px;
}
.mt-16 {
    margin-top: 16px;
}
.mt-24 {
    margin-top: 24px;
}
.mb-8 {
    margin-bottom: 8px;
}
.mb-16 {
    margin-bottom: 16px;
}
.mb-24 {
    margin-bottom: 24px;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Char counter for textareas */
.char-counter {
    font-size: 0.72rem;
    color: var(--light-text);
    text-align: right;
    margin-top: 4px;
}

.char-counter.near-limit {
    color: var(--warning);
}
.char-counter.at-limit {
    color: var(--danger);
}

/* Sortable drag handle */
.drag-handle {
    cursor: grab;
    color: var(--mid-grey);
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

/* ------------------------------------------------------------
   27. RESPONSIVE — 1024px
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ------------------------------------------------------------
   28. RESPONSIVE — 768px (tablet)
   ------------------------------------------------------------ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 72px;
        --topbar-height: 56px;
    }

    .sidebar {
        width: 72px;
    }

    .sidebar-brand .brand-name,
    .sidebar-brand .brand-sub,
    .brand-badge,
    .nav-section-title,
    .sidebar-nav li a span:not(.nav-icon),
    .nav-badge,
    .sidebar-footer a span:not(.nav-icon) {
        display: none;
    }

    .sidebar-brand {
        padding: 20px 16px;
    }

    .sidebar-nav ul {
        padding: 0 8px;
    }

    .sidebar-nav li a {
        padding: 11px;
        justify-content: center;
        gap: 0;
    }

    .sidebar-footer {
        padding: 12px 8px;
    }

    .sidebar-footer a {
        padding: 11px;
        justify-content: center;
        gap: 0;
    }

    .nav-icon {
        width: auto;
        font-size: 1.1rem;
    }

    .main-content {
        margin-left: 72px;
    }

    .page-content {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .cards-grid-2,
    .cards-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .message-detail-meta {
        grid-template-columns: 1fr;
    }

    .data-table td,
    .data-table th {
        padding: 10px 12px;
    }

    .login-card-body {
        padding: 24px 24px;
    }

    .login-card-header {
        padding: 24px 24px 18px;
    }
}

/* ------------------------------------------------------------
   29. RESPONSIVE — 480px (mobile)
   ------------------------------------------------------------ */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .topbar-left h1 {
        font-size: 1rem;
    }

    .user-info {
        display: none;
    }

    .topbar-btn.view-site {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-search {
        max-width: 100%;
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .setup-card {
        padding: 24px 20px;
    }
}

/* ------------------------------------------------------------
   30. PRINT
   ------------------------------------------------------------ */
@media print {
    .sidebar,
    .topbar,
    .form-actions,
    .table-toolbar,
    .pagination,
    .btn,
    .action-btn {
        display: none !important;
    }

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

    .page-content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    body {
        background: white;
        font-size: 11pt;
    }
}

/* ============================================================
   COMPATIBILITY — legacy class names used in admin pages
   ============================================================ */

/* Layout wrapper — pages use admin-wrapper as the main content area */
.admin-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}
@media (max-width: 768px) {
    .admin-wrapper { margin-left: 72px; }
}

/* Topbar alias */
.admin-topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    gap: 16px;
}
.topbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.topbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--mid-text);
    border-radius: 2px;
}
@media (max-width: 768px) {
    .topbar-toggle { display: flex; }
}
.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-text);
    flex: 1;
}
.topbar-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mid-text);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--light-grey);
    transition: var(--transition);
}
.topbar-link:hover { background: var(--mid-grey); color: var(--dark-text); }
.topbar-logout {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--danger);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(229,62,62,0.2);
    background: var(--danger-light);
    transition: var(--transition);
}
.topbar-logout:hover { background: var(--danger); color: var(--white); }

/* Main content area */
.admin-main {
    padding: 28px;
    flex: 1;
}
@media (max-width: 768px) {
    .admin-main { padding: 16px; }
}

/* Sidebar legacy structure */
.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex;
    flex-direction: column;
}
.sidebar-logo-main {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--white);
    white-space: nowrap;
}
.sidebar-logo-sub {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
}
.sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    display: none;
}
@media (max-width: 768px) {
    .sidebar-close { display: block; }
}

/* Nav items */
.nav-item { margin-bottom: 2px; }
.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}
.nav-item a:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.nav-item.active a,
.nav-item a.active {
    background: rgba(204,0,0,0.15);
    color: var(--white);
}
.nav-item.active a::before,
.nav-item a.active::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--orange);
    border-radius: 0 3px 3px 0;
}
.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 8px 14px;
}
.nav-logout a:hover { background: rgba(229,62,62,0.15); color: #fc8181; }

/* Badge in nav */
.badge {
    margin-left: auto;
    background: var(--orange);
    color: var(--white);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* Flash messages */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
}
.flash-success {
    background: var(--success-light);
    color: #276749;
    border-color: #c6f6d5;
}
.flash-error {
    background: var(--danger-light);
    color: #9b2c2c;
    border-color: #fed7d7;
}
.flash-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    font-size: 1rem;
    padding: 0 4px;
    flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 1.4rem;
    color: var(--dark-text);
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 0.88rem;
    color: var(--light-text);
    margin: 0;
}

/* Filter bar */
.filter-bar {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-group { display: flex; gap: 8px; align-items: center; }
.filter-input {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--dark-text);
    background: var(--light-grey);
    transition: var(--transition);
    min-width: 200px;
    font-family: var(--font);
}
.filter-input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(204,0,0,0.07);
}
.filter-select {
    padding: 8px 28px 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--mid-text);
    background: var(--light-grey);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    font-family: var(--font);
}
.filter-select:focus { outline: none; border-color: var(--blue); }

/* Table card wrapper */
.table-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}
.table-responsive { overflow-x: auto; }
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--light-grey);
    font-size: 0.82rem;
    color: var(--light-text);
    flex-wrap: wrap;
    gap: 10px;
}

/* Toggle buttons (publish/featured) */
.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    background: none;
    font-family: var(--font);
    white-space: nowrap;
}
.toggle-on {
    background: var(--success-light);
    color: var(--success);
    border-color: #c6f6d5;
}
.toggle-on:hover { background: var(--success); color: var(--white); }
.toggle-off {
    background: var(--light-grey);
    color: var(--light-text);
    border-color: var(--border);
}
.toggle-off:hover { background: var(--mid-grey); color: var(--dark-text); }

/* Action buttons in tables */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    background: none;
    font-family: var(--font);
}
.btn-edit {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(49,130,206,0.2);
}
.btn-edit:hover { background: var(--info); color: var(--white); border-color: var(--info); }
.btn-delete {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(229,62,62,0.2);
}
.btn-delete:hover { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-view {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(56,161,105,0.2);
}
.btn-view:hover { background: var(--success); color: var(--white); border-color: var(--success); }

/* Sort buttons */
.sort-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.btn-sort {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-text);
    font-size: 0.7rem;
    padding: 1px 4px;
    line-height: 1;
    transition: color 0.15s;
}
.btn-sort:hover { color: var(--orange); }
.sort-num {
    font-size: 0.75rem;
    color: var(--light-text);
    font-weight: 600;
}

/* Row states */
.row-draft td { opacity: 0.65; }
.row-unread td { font-weight: 600; }

/* Inline form */
.inline-form { display: inline; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--light-text);
}
.empty-state.large { padding: 64px 24px; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; display: block; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; color: var(--dark-text); margin-bottom: 8px; }
.empty-state p { font-size: 0.88rem; margin-bottom: 16px; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--light-text);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--light-text); }
.breadcrumb a:hover { color: var(--blue); }
.bc-sep { color: var(--mid-grey); }
.bc-current { color: var(--dark-text); font-weight: 600; }

/* Admin footer */
.admin-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--light-text);
    background: var(--white);
}

/* Text muted utility */
.text-muted { color: var(--light-text); font-size: 0.82rem; }

/* Category badge */
.category-badge {
    display: inline-block;
    background: rgba(204,0,0,0.07);
    color: var(--orange);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Action buttons group */
.action-btns {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
