/* eChiroMag admin dashboard skin, layered on top of Inspiro (style.css + plugins.css). */

:root {
    --admin-sidebar-width: 260px;
    --admin-sidebar-collapsed-width: 72px;
    --admin-topbar-height: 64px;
    --admin-bg: #f4f6fb;
    --admin-surface: #ffffff;
    --admin-border: #e6e9ef;
    --admin-text: #222a35;
    --admin-muted: #6b7280;
    --admin-primary: #1f6feb;
    --admin-primary-hover: #1a5ed2;
    --admin-sidebar-bg: #101828;
    --admin-sidebar-text: #cbd5e1;
    --admin-sidebar-text-muted: #94a3b8;
    --admin-sidebar-active-bg: rgba(31, 111, 235, 0.15);
    --admin-sidebar-active-text: #ffffff;
    --admin-danger: #dc2626;
    --admin-success: #16a34a;
    --admin-warning: #d97706;
    --admin-info: #0ea5e9;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* -----------------------------------------------------------------------
   Layout shell
----------------------------------------------------------------------- */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

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

body.sidebar-collapsed .admin-main {
    margin-left: var(--admin-sidebar-collapsed-width);
}

@media (max-width: 991.98px) {
    .admin-main {
        margin-left: 0;
    }
}

.admin-content {
    padding: 24px 28px 48px;
    flex: 1 1 auto;
}

/* -----------------------------------------------------------------------
   Sidebar
----------------------------------------------------------------------- */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--admin-sidebar-width);
    background-color: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform .2s ease, width .2s ease;
}

.admin-sidebar .brand {
    height: var(--admin-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar .brand a {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar .brand .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1f6feb, #22d3ee);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.admin-sidebar .sidebar-nav {
    list-style: none;
    padding: 12px 8px;
    margin: 0;
    overflow-y: auto;
    flex: 1 1 auto;
}

.admin-sidebar .sidebar-nav .nav-section {
    color: var(--admin-sidebar-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: 16px 14px 8px;
}

.admin-sidebar .sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--admin-sidebar-text);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}

.admin-sidebar .sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.admin-sidebar .sidebar-nav a.active {
    background-color: var(--admin-sidebar-active-bg);
    color: var(--admin-sidebar-active-text);
}

.admin-sidebar .sidebar-nav a i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.admin-sidebar .sidebar-footer {
    padding: 12px 16px 16px;
    font-size: 12px;
    color: var(--admin-sidebar-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Collapsed sidebar (desktop) — narrows to an icon rail and hides text labels.
   The matching .admin-main margin shrink already lives at the top of this file. */
body.sidebar-collapsed .admin-sidebar {
    width: var(--admin-sidebar-collapsed-width);
}

body.sidebar-collapsed .admin-sidebar .brand {
    padding: 0;
    justify-content: center;
}

body.sidebar-collapsed .admin-sidebar .brand-text {
    display: none;
}

body.sidebar-collapsed .admin-sidebar .sidebar-nav {
    padding: 12px 6px;
}

body.sidebar-collapsed .admin-sidebar .sidebar-nav .nav-section {
    /* Section headers are pure text labels — hide them when text is hidden,
       but keep the spacing they introduced via a small top margin on the
       following <li>. */
    height: 12px;
    padding: 12px 0 0;
    overflow: hidden;
    text-indent: -9999px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8px;
}

body.sidebar-collapsed .admin-sidebar .sidebar-nav a {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
    position: relative;
}

body.sidebar-collapsed .admin-sidebar .sidebar-nav a span {
    display: none;
}

body.sidebar-collapsed .admin-sidebar .sidebar-nav a i {
    width: auto;
    font-size: 18px;
}

/* Hover-tooltip via the link's text content so users still get labels. */
body.sidebar-collapsed .admin-sidebar .sidebar-nav a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 1040;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.sidebar-collapsed .admin-sidebar .sidebar-nav a:hover::after {
    opacity: 1;
}

/* The user's email lives in the topbar's user-chip already, so we hide
   the redundant sidebar footer in collapsed mode rather than try to
   squeeze an email into a 72 px column. */
body.sidebar-collapsed .admin-sidebar .sidebar-footer {
    display: none;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

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

/* -----------------------------------------------------------------------
   Topbar
----------------------------------------------------------------------- */
.admin-topbar {
    height: var(--admin-topbar-height);
    background-color: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.admin-topbar .topbar-left,
.admin-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-topbar .sidebar-toggle {
    background: none;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text);
    cursor: pointer;
}

.admin-topbar .page-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--admin-text);
}

.admin-topbar .user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background-color: #fff;
    color: var(--admin-text);
    font-size: 13px;
    font-weight: 500;
}

.admin-topbar .user-chip .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f6feb, #22d3ee);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

.admin-topbar .logout-form {
    margin: 0;
}

.admin-topbar .logout-form .btn-logout {
    background: none;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.admin-topbar .logout-form .btn-logout:hover {
    background-color: var(--admin-bg);
}

/* -----------------------------------------------------------------------
   Page header
----------------------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.page-header .breadcrumbs {
    font-size: 13px;
    color: var(--admin-muted);
}

.page-header .breadcrumbs a {
    color: var(--admin-muted);
    text-decoration: none;
}

.page-header .breadcrumbs a:hover {
    color: var(--admin-primary);
}

/* -----------------------------------------------------------------------
   Cards / surfaces
----------------------------------------------------------------------- */
.admin-card {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.admin-card + .admin-card {
    margin-top: 20px;
}

.admin-card > .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-card > .card-header h2,
.admin-card > .card-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.admin-card > .card-body {
    padding: 20px;
}

.admin-card > .card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--admin-border);
    background-color: #fafbfc;
    border-radius: 0 0 12px 12px;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex: 0 0 auto;
}

.stat-card.stat-primary .stat-icon { background-color: var(--admin-primary); }
.stat-card.stat-success .stat-icon { background-color: var(--admin-success); }
.stat-card.stat-warning .stat-icon { background-color: var(--admin-warning); }
.stat-card.stat-info    .stat-icon { background-color: var(--admin-info); }

.stat-card .stat-meta .label {
    display: block;
    color: var(--admin-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 2px;
}

.stat-card .stat-meta .value {
    font-size: 22px;
    font-weight: 600;
}

/* -----------------------------------------------------------------------
   Forms
----------------------------------------------------------------------- */
.admin-form .form-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.admin-form .form-group {
    grid-column: span 12;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-form .form-group.span-6 { grid-column: span 12; }
@media (min-width: 768px) {
    .admin-form .form-group.span-6 { grid-column: span 6; }
    .admin-form .form-group.span-4 { grid-column: span 4; }
    .admin-form .form-group.span-3 { grid-column: span 3; }
}

.admin-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text);
}

.admin-form .hint {
    font-size: 12px;
    color: var(--admin-muted);
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="url"],
.admin-form input[type="datetime-local"],
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background-color: #fff;
    color: var(--admin-text);
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}

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

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15);
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------------
   Buttons
----------------------------------------------------------------------- */
.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    line-height: 1.2;
}

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

.btn-admin.btn-primary:hover {
    background-color: var(--admin-primary-hover);
}

.btn-admin.btn-secondary {
    background-color: #fff;
    color: var(--admin-text);
    border-color: var(--admin-border);
}

.btn-admin.btn-secondary:hover {
    background-color: var(--admin-bg);
}

.btn-admin.btn-danger {
    background-color: var(--admin-danger);
    color: #fff;
}

.btn-admin.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-admin.btn-warning {
    background-color: #f59e0b;
    color: #fff;
}

.btn-admin.btn-warning:hover {
    background-color: #d97706;
}

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

/* -----------------------------------------------------------------------
   Tables
----------------------------------------------------------------------- */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.admin-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 12px 16px;
    background-color: #fafbfc;
    border-bottom: 1px solid var(--admin-border);
}

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

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

.admin-table tbody tr:hover td {
    background-color: #fafbfc;
}

/* -----------------------------------------------------------------------
   Badges / pills
----------------------------------------------------------------------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    background-color: #eef2f7;
    color: #475569;
    text-transform: capitalize;
}

.status-pill.status-published { background-color: #dcfce7; color: #166534; }
.status-pill.status-draft     { background-color: #eef2f7; color: #475569; }
.status-pill.status-review    { background-color: #fef3c7; color: #92400e; }
.status-pill.status-scheduled { background-color: #dbeafe; color: #1e40af; }
.status-pill.status-archived  { background-color: #fee2e2; color: #991b1b; }

/* -----------------------------------------------------------------------
   Alerts
----------------------------------------------------------------------- */
.admin-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.admin-alert i {
    margin-top: 2px;
}

.admin-alert.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.admin-alert.alert-success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.admin-alert.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* -----------------------------------------------------------------------
   Auth screens (login / register)
----------------------------------------------------------------------- */
body.auth-body {
    background-color: var(--admin-bg);
    min-height: 100vh;
    margin: 0;
    font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

@media (min-width: 992px) {
    .auth-layout {
        grid-template-columns: 1fr 1fr;
    }
}

.auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background-color: #fff;
}

.auth-form-inner {
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.auth-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1f6feb, #22d3ee);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.auth-brand .brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--admin-text);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--admin-text);
}

.auth-subtitle {
    color: var(--admin-muted);
    font-size: 14px;
    margin: 0 0 28px;
}

.auth-cover {
    display: none;
    background-color: #101828;
    background-image: linear-gradient(135deg, rgba(16, 24, 40, 0.85), rgba(31, 111, 235, 0.65)), url('/assets/images/parallax/4.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 48px;
    position: relative;
}

@media (min-width: 992px) {
    .auth-cover {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }
}

.auth-cover .cover-copy {
    max-width: 420px;
}

.auth-cover .cover-copy h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
}

.auth-cover .cover-copy p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}
