/* Skrift CMS — Admin Theme
   ======================================== */

/* ========================================
   Admin Component Variables
   ======================================== */

:root {
    --sk-admin-sidebar-bg: #1e2a3a;
    --sk-admin-sidebar-width: 15.5rem;
    --sk-admin-sidebar-text: #fff;
    --sk-admin-sidebar-muted: rgba(255, 255, 255, 0.4);
    --sk-admin-sidebar-border: rgba(255, 255, 255, 0.08);
    --sk-admin-sidebar-link: rgba(255, 255, 255, 0.45);
    --sk-admin-sidebar-link-hover: rgba(255, 255, 255, 0.8);
    --sk-admin-sidebar-link-hover-bg: rgba(255, 255, 255, 0.03);
    --sk-admin-sidebar-active-bg: rgba(59, 108, 231, 0.15);
}

/* ========================================
   Admin Layout
   ======================================== */

.sk-admin {
    display: grid;
    grid-template-columns: var(--sk-admin-sidebar-width) 1fr;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .sk-admin {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Sidebar
   ======================================== */

.sk-sidebar {
    background: var(--sk-admin-sidebar-bg);
    color: var(--sk-admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .sk-sidebar {
        position: static;
        height: auto;
    }
}

/* All links inside sidebar should inherit sidebar colors, not accent blue */
.sk-sidebar a {
    color: inherit;
}

.sk-sidebar a:hover {
    color: inherit;
}

/* Sidebar Brand */
.sk-sidebar-brand {
    padding: 1.75rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--sk-admin-sidebar-border);
}

.sk-sidebar-brand h1 {
    font-family: var(--sk-font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    margin-bottom: 0;
    color: inherit;
}

.sk-sidebar-brand .sk-sidebar-sub {
    font-size: 1rem;
    color: var(--sk-admin-sidebar-muted);
    margin-top: 0.25rem;
}

/* Sidebar Nav */
.sk-sidebar-nav {
    padding: 0.75rem 0;
}

.sk-sidebar-link {
    display: block;
    padding: 0.5625rem 1.5rem;
    font-size: 1rem;
    color: var(--sk-admin-sidebar-link);
    transition: all var(--sk-transition-fast);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sk-sidebar-link:hover {
    color: var(--sk-admin-sidebar-link-hover);
    background: var(--sk-admin-sidebar-link-hover-bg);
}

.sk-sidebar-link.active {
    color: #fff;
    background: var(--sk-admin-sidebar-active-bg);
    border-left-color: var(--sk-color-accent);
}

/* Sidebar Footer */
.sk-sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sk-admin-sidebar-border);
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}

.sk-sidebar-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    background: var(--sk-color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sk-font-display);
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
}

.sk-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sk-sidebar-user .sk-sidebar-name {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.sk-sidebar-user .sk-sidebar-role {
    font-size: 1rem;
    color: var(--sk-admin-sidebar-muted);
}

/* ========================================
   Dashboard Content Area
   ======================================== */

.sk-admin-content {
    padding: 2rem 2.25rem;
    overflow-y: auto;
    min-width: 0;
}

@media (max-width: 768px) {
    .sk-admin-content {
        padding: 1.5rem 1rem;
    }
}

/* ========================================
   Admin Header
   ======================================== */

.sk-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sk-space-lg);
    margin-bottom: 1.75rem;
}

.sk-admin-header h1 {
    font-family: var(--sk-font-display);
    font-size: 1.5rem;
    font-weight: 500;
}

.sk-admin-header .sk-admin-context {
    font-size: 1rem;
    color: var(--sk-color-muted);
}

.sk-admin-header [role="button"] {
    margin-top: 0;
    flex-shrink: 0;
}

/* ========================================
   Stat Cards
   ======================================== */

.sk-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .sk-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sk-stat-card {
    background: var(--sk-color-surface);
    border: 1px solid var(--sk-color-border);
    border-radius: var(--sk-radius-lg);
    padding: 1.25rem 1.375rem;
    transition: box-shadow var(--sk-transition-normal);
}

.sk-stat-card:hover {
    box-shadow: 0 0.125rem 0.75rem rgba(0, 0, 0, 0.04);
}

.sk-stat-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sk-color-muted);
    margin-bottom: 0.5rem;
}

.sk-stat-value {
    font-family: var(--sk-font-display);
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--sk-color-text);
}

.sk-stat-sub {
    font-size: 1rem;
    color: var(--sk-color-accent);
    margin-top: 0.25rem;
}

/* ========================================
   Panels
   ======================================== */

.sk-panel {
    background: var(--sk-color-surface);
    border: 1px solid var(--sk-color-border);
    border-radius: var(--sk-radius-lg);
    overflow: hidden;
}

.sk-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.375rem;
    border-bottom: 1px solid var(--sk-color-border);
}

.sk-panel-head h2,
.sk-panel-head h3 {
    font-family: var(--sk-font-display);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0;
}

.sk-panel-body {
    padding: var(--sk-space-lg);
}

/* ========================================
   Content Rows
   ======================================== */

.sk-content-row {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.375rem;
    border-bottom: 1px solid var(--sk-color-border);
    transition: background var(--sk-transition-fast);
}

.sk-content-row:last-child {
    border-bottom: none;
}

.sk-content-row:hover {
    background: var(--sk-color-warm);
}

.sk-content-row-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.sk-content-row-author {
    flex: 0 0 8.125rem;
    font-size: 1rem;
    color: var(--sk-color-muted);
}

.sk-content-row-date {
    flex: 0 0 6.25rem;
    font-size: 1rem;
    color: var(--sk-color-muted);
}

.sk-content-row-status {
    flex: 0 0 5.625rem;
}

/* ========================================
   Status Pills
   ======================================== */

.sk-pill {
    display: inline-block;
    font-size: 1rem;
    padding: 0.1875rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.sk-pill-published {
    background: rgba(58, 138, 58, 0.1);
    color: var(--sk-color-success);
}

.sk-pill-draft {
    background: var(--sk-color-accent-soft);
    color: var(--sk-color-accent);
}

.sk-pill-review {
    background: rgba(184, 134, 45, 0.1);
    color: var(--sk-color-warning);
}

/* ========================================
   Admin Lower Section
   ======================================== */

.sk-admin-lower {
    display: grid;
    grid-template-columns: 1fr 20rem;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

@media (max-width: 900px) {
    .sk-admin-lower {
        grid-template-columns: 1fr;
    }
}

.sk-mini-panel {
    background: var(--sk-color-surface);
    border: 1px solid var(--sk-color-border);
    border-radius: var(--sk-radius-lg);
    padding: 1.25rem 1.375rem;
}

.sk-mini-panel h4 {
    font-family: var(--sk-font-display);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sk-color-muted);
    margin-bottom: 0.875rem;
}

.sk-mini-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4375rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sk-mini-row:last-child {
    border-bottom: none;
}

.sk-mini-row-label {
    color: var(--sk-color-muted);
}

.sk-mini-row-value {
    font-weight: 600;
}

.sk-activity-item {
    padding: 0.625rem 0;
    font-size: 1rem;
    color: var(--sk-color-muted);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sk-activity-item:last-child {
    border-bottom: none;
}

.sk-activity-item strong {
    color: var(--sk-color-text);
}

.sk-activity-time {
    font-size: 1rem;
    margin-top: 0.125rem;
}

/* ========================================
   Admin Tables
   ======================================== */

.sk-admin-table {
    width: 100%;
    margin-top: var(--sk-space-lg);
}

.sk-admin-table th,
.sk-admin-table td {
    padding: var(--sk-space-sm) var(--sk-space-md);
    text-align: left;
    vertical-align: middle;
}

.sk-admin-table th {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sk-color-muted);
}

/* ========================================
   Admin Quick Links (Dashboard Cards)
   ======================================== */

.sk-admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: var(--sk-space-lg);
    margin-top: var(--sk-space-lg);
}

.sk-admin-card {
    display: block;
    padding: var(--sk-space-lg);
    background-color: var(--sk-color-surface);
    border: 1px solid var(--sk-color-border);
    border-radius: var(--sk-radius-lg);
    transition: box-shadow var(--sk-transition-fast), transform var(--sk-transition-fast);
    text-decoration: none;
    color: inherit;
}

.sk-admin-card:hover {
    box-shadow: var(--sk-shadow-md);
    transform: translateY(-0.125rem);
    color: inherit;
}

.sk-admin-card h3 {
    margin-bottom: var(--sk-space-xs);
    font-size: 1.125rem;
}

.sk-admin-card p {
    color: var(--sk-color-muted);
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   Dark Theme (System Preference)
   ======================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --sk-admin-sidebar-bg: #12151a;
    }

    .sk-stat-card:hover {
        box-shadow: 0 0.125rem 0.75rem rgba(0, 0, 0, 0.2);
    }

    .sk-pill-published {
        background: rgba(90, 173, 90, 0.15);
    }

    .sk-pill-review {
        background: rgba(212, 162, 74, 0.15);
    }

    .sk-mini-row {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .sk-activity-item {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }
}
