:root {
    --bg: #030507;
    --surface-low: rgba(255, 255, 255, 0.02);
    --surface: rgba(255, 255, 255, 0.04);
    --surface-high: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-glow: rgba(255, 255, 255, 0.15);
    --primary: #ffffff;
    --primary-light: #e2e8f0;
    --primary-dark: #94a3b8;
    --cream: #f8fafc;
    --muted: #8b97a8;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Manrope', system-ui, sans-serif;
    --glow-shadow: 0 0 24px rgba(255, 255, 255, 0.15);
    --status-green: #4ade80;
    --status-yellow: #facc15;
    --status-red: #f87171;
    --status-blue: #60a5fa;
    --status-green-bg: rgba(74, 222, 128, 0.1);
    --status-yellow-bg: rgba(250, 204, 21, 0.1);
    --status-red-bg: rgba(248, 113, 113, 0.1);
    --status-blue-bg: rgba(96, 165, 250, 0.1);
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg);
    color: var(--cream);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

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

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo i {
    width: 24px;
    height: 24px;
    stroke: var(--cream);
}

.sidebar-brand {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.08em;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
}
.sidebar-close i {
    width: 20px;
    height: 20px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--cream);
    background: var(--surface);
}

.nav-item.active {
    color: var(--cream);
    background: var(--surface-high);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
}

.main-area {
    margin-left: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
    z-index: 50;
}

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

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--cream);
    cursor: pointer;
    padding: 4px;
}
.hamburger i {
    width: 22px;
    height: 22px;
}

.topbar-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.02em;
}

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--cream);
}
.user-badge i {
    width: 16px;
    height: 16px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

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

.card-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--cream);
}

.card-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

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

.data-table tbody tr:nth-child(even) {
    background: var(--surface-low);
}

.data-table tbody tr:hover {
    background: var(--surface);
}

.data-table tbody td {
    padding: 12px 16px;
    color: var(--cream);
    white-space: nowrap;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.stat-card .stat-icon i {
    width: 20px;
    height: 20px;
}

.stat-card .stat-icon.icon-blue {
    background: var(--status-blue-bg);
    color: var(--status-blue);
}
.stat-card .stat-icon.icon-green {
    background: var(--status-green-bg);
    color: var(--status-green);
}
.stat-card .stat-icon.icon-yellow {
    background: var(--status-yellow-bg);
    color: var(--status-yellow);
}
.stat-card .stat-icon.icon-red {
    background: var(--status-red-bg);
    color: var(--status-red);
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--cream);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--cream);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-hover);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b97a8' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input::placeholder,
textarea::placeholder {
    color: var(--primary-dark);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover {
    opacity: 0.9;
}
.btn-primary:active {
    transform: scale(0.98);
}
.btn-primary i {
    width: 16px;
    height: 16px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--cream);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-ghost:hover {
    border-color: var(--border-hover);
    background: var(--surface);
}
.btn-ghost i {
    width: 16px;
    height: 16px;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}
.btn-danger i {
    width: 16px;
    height: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-icon:hover {
    color: var(--cream);
    border-color: var(--border-hover);
    background: var(--surface);
}
.btn-icon i {
    width: 16px;
    height: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-green {
    background: var(--status-green-bg);
    color: var(--status-green);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.badge-yellow {
    background: var(--status-yellow-bg);
    color: var(--status-yellow);
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.badge-red {
    background: var(--status-red-bg);
    color: var(--status-red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-blue {
    background: var(--status-blue-bg);
    color: var(--status-blue);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.badge-gold {
    background: rgba(250, 204, 21, 0.15);
    color: #fde047;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.badge-silver {
    background: var(--surface-high);
    color: var(--primary-light);
    border: 1px solid var(--border-hover);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.pagination button:hover {
    border-color: var(--border-hover);
    color: var(--cream);
    background: var(--surface);
}
.pagination button.active {
    background: var(--surface-high);
    color: var(--cream);
    border-color: var(--border-hover);
}
.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.visible {
    display: flex;
}

.modal {
    background: #0a0d12;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 24px;
}

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

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    max-width: 360px;
    backdrop-filter: blur(12px);
}

.toast-success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--status-green);
}

.toast-error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--status-red);
}

.toast-info {
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: var(--status-blue);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-light);
    border-top-color: var(--cream);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 60px auto;
}

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

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 250;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.confirm-overlay.visible {
    display: flex;
}

.confirm-dialog {
    background: #0a0d12;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 100%;
}

.confirm-dialog p {
    font-size: 15px;
    color: var(--cream);
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.search-bar {
    position: relative;
    max-width: 400px;
    margin-bottom: 20px;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.search-bar input {
    padding-left: 40px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
}

.filter-bar select,
.filter-bar input {
    min-width: 160px;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.tab-btn:hover {
    color: var(--cream);
}
.tab-btn.active {
    color: var(--cream);
    border-bottom-color: var(--cream);
}

.detail-card {
    background: var(--surface-high);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 12px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-row .detail-key {
    color: var(--muted);
    font-weight: 500;
}
.detail-row .detail-value {
    color: var(--cream);
    text-align: right;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--muted);
}
.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state p {
    font-size: 15px;
}

.error-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--status-red);
}
.error-state p {
    font-size: 14px;
    margin-top: 8px;
    color: var(--muted);
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.campaign-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.campaign-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-high);
}

.campaign-card-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 12px;
}

.campaign-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.campaign-card-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

.star-rating {
    color: var(--status-yellow);
}

.section-gap {
    margin-bottom: 32px;
}

.actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.settings-group {
    margin-bottom: 32px;
}

.settings-group-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.settings-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.settings-key {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
    padding-top: 10px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .settings-row {
        grid-template-columns: 1fr;
    }
    .settings-key {
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close {
        display: block;
    }
    .sidebar-overlay.visible {
        display: block;
    }
    .main-area {
        margin-left: 0;
    }
    .hamburger {
        display: block;
    }
    .content-area {
        padding: 20px 16px;
    }
    .topbar {
        padding: 0 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar select,
    .filter-bar input {
        min-width: 100%;
    }
    .data-table {
        font-size: 13px;
    }
    .data-table thead th,
    .data-table tbody td {
        padding: 10px 8px;
    }
    .user-badge span {
        display: none;
    }
}
