/* ==========================================================================
   Macroverse CMS - Admin Panel Stylesheet
   ========================================================================== */

:root {
    --adm-bg: #090d16;
    --adm-surface: #0f1523;
    --adm-card: #151c2e;
    --adm-border: #212a42;
    --adm-border-focus: #4f46e5;
    --adm-text: #f8fafc;
    --adm-text-muted: #8b99b5;
    --adm-primary: #6366f1;
    --adm-primary-hover: #4f46e5;
    --adm-accent: #38bdf8;
    --adm-success: #10b981;
    --adm-danger: #ef4444;
    --adm-warning: #f59e0b;
    --adm-radius: 8px;
    --sidebar-width: 260px;
}

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

body {
    background: var(--adm-bg);
    color: var(--adm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   Admin Layout: Sidebar + Main Content
   ========================================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--adm-surface);
    border-right: 1px solid var(--adm-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--adm-border);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-brand span {
    color: var(--adm-accent);
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    overflow-y: auto;
    flex: 1;
}

.menu-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--adm-text-muted);
    padding: 12px 12px 6px 12px;
    letter-spacing: 0.05em;
}

.menu-item {
    margin-bottom: 2px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--adm-radius);
    color: var(--adm-text-muted);
    font-weight: 500;
    transition: all 0.15s ease;
}

.menu-link:hover, .menu-link.active {
    background: rgba(99, 102, 241, 0.12);
    color: #fff;
}

.menu-link.active {
    color: var(--adm-accent);
    font-weight: 600;
}

.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 64px;
    background: var(--adm-surface);
    border-bottom: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.content-body {
    padding: 32px;
    flex: 1;
}

/* ==========================================================================
   Stats Cards & Dashboards
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 20px;
}

.stat-title {
    font-size: 0.8rem;
    color: var(--adm-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-card {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    overflow: hidden;
}

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

.adm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.adm-table th {
    background: rgba(15, 21, 35, 0.6);
    padding: 12px 24px;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--adm-text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--adm-border);
}

.adm-table td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--adm-border);
    vertical-align: middle;
}

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

.adm-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* ==========================================================================
   Buttons & Form Controls
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--adm-radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--adm-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--adm-primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid var(--adm-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--adm-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: var(--adm-danger);
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

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

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: #fff;
}

.form-control {
    width: 100%;
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 10px 14px;
    color: #fff;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.15s ease;
}

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

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

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-published {
    background: rgba(16, 185, 129, 0.15);
    color: var(--adm-success);
}

.badge-draft {
    background: rgba(139, 153, 181, 0.15);
    color: var(--adm-text-muted);
}

.badge-scheduled {
    background: rgba(245, 158, 11, 0.15);
    color: var(--adm-warning);
}

@keyframes admSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-animation {
    animation: admSpin 1s linear infinite;
    display: inline-block;
}
