/* ============================================================
   Academic Publishing System — Frontend Portal
   Premium SaaS Design | Light Theme
   Inspired by: Stripe, Linear, Vercel, Notion
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset & Scope ──────────────────────────────────────────── */
#aps-frontend-container,
#aps-frontend-container * {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ── Design Tokens ──────────────────────────────────────────── */
#aps-frontend-container {
    /* Colors */
    --c-bg:          #f5f5f5;
    --c-surface:     #ffffff;
    --c-border:      #e5e7eb;
    --c-border-soft: #f3f4f6;
    --c-text-1:      #111827;
    --c-text-2:      #6b7280;
    --c-text-3:      #9ca3af;
    --c-blue:        #2563eb;
    --c-blue-soft:   rgba(37,99,235,0.08);
    --c-green:       #10b981;
    --c-green-soft:  rgba(16,185,129,0.08);
    --c-amber:       #f59e0b;
    --c-amber-soft:  rgba(245,158,11,0.08);
    --c-red:         #ef4444;
    --c-red-soft:    rgba(239,68,68,0.08);
    --c-purple:      #7c3aed;
    --c-purple-soft: rgba(124,58,237,0.08);
    --c-cyan:        #06b6d4;
    --c-cyan-soft:   rgba(6,182,212,0.08);

    /* Shadows */
    --shadow-xs:     0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm:     0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
    --shadow-md:     0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);

    /* Radii */
    --r-sm:   6px;
    --r-md:   8px;
    --r-lg:   12px;
    --r-full: 9999px;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 96px;

    /* ── Outer shell ── */
    width: 100% !important;
    max-width: none !important;
    background: var(--c-bg) !important;
    color: var(--c-text-1) !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden;
}

/* Prevent theme/Elementor from breaking images and SVGs */
#aps-frontend-container img {
    max-width: 100% !important;
    height: auto !important;
    display: inline-block;
}
#aps-frontend-container svg {
    display: inline-block;
    vertical-align: middle;
}

/* ── Top Navigation Bar ─────────────────────────────────────── */
#aps-navbar {
    width: 100%;
    height: var(--header-height);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

#aps-navbar .aps-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#aps-navbar .aps-logo img {
    height: 70px !important;
    width: auto !important;
    max-width: 320px !important;
    object-fit: contain !important;
}

#aps-navbar .aps-logo h2 {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--c-text-1) !important;
    margin: 0 !important;
    letter-spacing: -0.3px;
}

#aps-navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Role switcher (admin only) */
#aps-navbar .role-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--c-border-soft);
    padding: 4px;
    border-radius: var(--r-md);
    margin-right: 12px;
}

#aps-navbar .role-switcher a {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--r-sm);
    color: var(--c-text-2);
    text-decoration: none !important;
    transition: all 0.15s;
}

#aps-navbar .role-switcher a.active {
    background: var(--c-surface);
    color: var(--c-text-1);
    box-shadow: var(--shadow-xs);
}

/* Icon buttons in navbar */
#aps-frontend-container .aps-nav-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: transparent;
    border: 1px solid var(--c-border);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--c-text-2);
    transition: all 0.15s;
}

#aps-frontend-container .aps-nav-icon-btn:hover {
    background: var(--c-border-soft);
    color: var(--c-text-1);
}

#aps-frontend-container .aps-nav-icon-btn svg {
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    visibility: visible !important;
    stroke: currentColor !important;
}

.aps-nav-icon-btn .aps-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--c-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--c-surface);
}

.aps-nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--c-border);
    cursor: pointer;
    flex-shrink: 0;
}

.aps-nav-avatar img {
    width: 34px !important;
    height: 34px !important;
    object-fit: cover;
    display: block;
}

/* ── Body Layout (Sidebar + Content) ───────────────────────── */
#aps-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* ── Sidebar ────────────────────────────────────────────────── */
#aps-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    padding: 20px 12px;
    gap: 4px;
    overflow-y: auto;
    min-height: calc(100vh - var(--header-height));
}

.aps-nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--c-text-3);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 12px 10px 4px;
    margin-top: 4px;
}

.aps-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-2);
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.aps-nav-item:hover {
    background: var(--c-border-soft);
    color: var(--c-text-1);
}

.aps-nav-item.active {
    background: var(--c-blue-soft);
    color: var(--c-blue);
    font-weight: 600;
    border-color: rgba(37,99,235,0.12);
}

.aps-nav-item svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
}

.aps-nav-item .nav-badge {
    margin-left: auto;
    background: var(--c-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aps-nav-item .nav-badge.soft {
    background: var(--c-blue-soft);
    color: var(--c-blue);
}

.aps-nav-item.active .nav-badge.soft {
    background: rgba(255,255,255,0.5);
    color: var(--c-blue);
}

/* Sidebar spacer pushes user card to bottom */
.aps-sidebar-spacer { flex: 1; }

.aps-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    margin-top: 8px;
    background: var(--c-border-soft);
}

.aps-sidebar-user img {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.aps-sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.aps-sidebar-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-1);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aps-sidebar-user-role {
    font-size: 11px;
    color: var(--c-text-3);
    display: block;
}

.aps-sidebar-user a {
    color: var(--c-text-3);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

.aps-sidebar-user a:hover {
    color: var(--c-red);
}

.aps-sidebar-user a svg {
    width: 13px !important;
    height: 13px !important;
}

/* ── Main Content Area ──────────────────────────────────────── */
#aps-main {
    flex: 1;
    min-width: 0;
    padding: 32px 36px;
    overflow-x: hidden;
    background: var(--c-bg);
}

/* ── Tab Panels ─────────────────────────────────────────────── */
.aps-view {
    display: none;
    width: 100%;
    animation: aps-fadein 0.15s ease;
}

.aps-view.active {
    display: block;
    width: 100%;
}

@keyframes aps-fadein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ────────────────────────────────────────────── */
.aps-page-header {
    margin-bottom: 28px;
}

.aps-page-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--c-text-1) !important;
    margin: 0 0 4px 0 !important;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.aps-page-subtitle {
    font-size: 13px;
    color: var(--c-text-2);
    margin: 0;
    line-height: 1.5;
}

/* ── Cards ──────────────────────────────────────────────────── */
.aps-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.aps-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text-1);
    margin: 0 0 16px 0;
}

/* ── Grid Layouts ───────────────────────────────────────────── */
.aps-grid-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.aps-grid-2 {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.aps-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (max-width: 1200px) {
    .aps-grid-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .aps-grid-stats { grid-template-columns: repeat(2, 1fr); }
    .aps-grid-2     { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .aps-grid-stats { grid-template-columns: 1fr; }
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.aps-stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.aps-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.aps-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.aps-stat-icon svg {
    width: 17px !important;
    height: 17px !important;
}

.aps-stat-number {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--c-text-1) !important;
    line-height: 1;
    letter-spacing: -1px;
}

.aps-stat-label {
    font-size: 12px;
    color: var(--c-text-2);
    font-weight: 500;
}

/* ── Tables ─────────────────────────────────────────────────── */
.aps-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.aps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.aps-table thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.aps-table tbody td {
    padding: 13px 16px;
    color: var(--c-text-1);
    border-bottom: 1px solid var(--c-border-soft);
    vertical-align: middle;
}

.aps-table tbody tr:last-child td {
    border-bottom: none;
}

.aps-table tbody tr:hover td {
    background: var(--c-border-soft);
}

.aps-table .col-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-2);
}

.aps-table .col-title {
    font-weight: 600;
    color: var(--c-text-1);
    max-width: 300px;
}

.aps-table .col-title span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--c-text-3);
    margin-top: 2px;
}

/* ── Badges / Status Pills ──────────────────────────────────── */
.aps-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.aps-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.aps-badge.pending        { background: var(--c-amber-soft); color: var(--c-amber); }
.aps-badge.under_review   { background: var(--c-blue-soft);  color: var(--c-blue); }
.aps-badge.revision_required { background: var(--c-purple-soft); color: var(--c-purple); }
.aps-badge.accepted       { background: var(--c-green-soft); color: var(--c-green); }
.aps-badge.published      { background: var(--c-cyan-soft);  color: var(--c-cyan); }
.aps-badge.rejected       { background: var(--c-red-soft);   color: var(--c-red); }

/* ── Buttons ─────────────────────────────────────────────────── */
.aps-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none !important;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif !important;
}

.aps-btn svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
}

.aps-btn-primary {
    background: var(--c-blue);
    color: #ffffff !important;
}
.aps-btn-primary:hover { background: #1d4ed8; }

.aps-btn-secondary {
    background: var(--c-surface);
    color: var(--c-text-1) !important;
    border: 1px solid var(--c-border);
}
.aps-btn-secondary:hover { background: var(--c-border-soft); }

.aps-btn-ghost {
    background: transparent;
    color: var(--c-text-2) !important;
    border: 1px solid transparent;
}
.aps-btn-ghost:hover { background: var(--c-border-soft); color: var(--c-text-1) !important; }

.aps-btn-danger { background: var(--c-red); color: #fff !important; }
.aps-btn-danger:hover { background: #dc2626; }

.aps-btn-sm { padding: 5px 11px; font-size: 12px; }
.aps-btn-lg { padding: 11px 22px; font-size: 14px; }

/* Action icon button */
.aps-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--c-text-2);
    text-decoration: none !important;
    transition: all 0.15s;
}
.aps-icon-btn:hover { background: var(--c-border-soft); color: var(--c-blue); border-color: var(--c-blue); }
.aps-icon-btn svg { width: 13px !important; height: 13px !important; }

/* ── Forms ──────────────────────────────────────────────────── */
.aps-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aps-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-1);
}

.aps-input,
.aps-textarea,
.aps-select,
.aps-form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 13px;
    font-family: 'Inter', sans-serif !important;
    color: var(--c-text-1);
    background: var(--c-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}

.aps-input:focus,
.aps-textarea:focus,
.aps-select:focus,
.aps-form-control:focus {
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.aps-input[disabled],
.aps-form-control[disabled] {
    background: var(--c-border-soft);
    color: var(--c-text-3);
    cursor: not-allowed;
}

.aps-textarea,
.aps-form-control textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.aps-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.aps-alert svg { width: 15px !important; height: 15px !important; flex-shrink: 0; margin-top: 1px; }
.aps-alert-error   { background: var(--c-red-soft);   color: #b91c1c; border: 1px solid rgba(239,68,68,0.2); }
.aps-alert-success { background: var(--c-green-soft);  color: #065f46; border: 1px solid rgba(16,185,129,0.2); }
.aps-alert-info    { background: var(--c-blue-soft);   color: #1e40af; border: 1px solid rgba(37,99,235,0.2); }
.aps-alert-warning { background: var(--c-amber-soft);  color: #92400e; border: 1px solid rgba(245,158,11,0.2); }

/* ── Flex utilities ──────────────────────────────────────────── */
.aps-flex         { display: flex; align-items: center; }
.aps-flex-between { display: flex; align-items: center; justify-content: space-between; }
.aps-flex-gap     { display: flex; align-items: center; gap: 12px; }

/* ── Divider ─────────────────────────────────────────────────── */
.aps-divider { border: none; border-top: 1px solid var(--c-border); margin: 20px 0; }

/* ── Empty State ─────────────────────────────────────────────── */
.aps-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--c-text-2);
}
.aps-empty svg { margin: 0 auto 12px; color: var(--c-text-3); }
.aps-empty h4 { font-size: 15px; font-weight: 600; color: var(--c-text-1); margin: 0 0 6px; }
.aps-empty p  { font-size: 13px; margin: 0 0 16px; }

/* ── Timeline ────────────────────────────────────────────────── */
.aps-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.aps-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: var(--c-border);
}

.aps-tl-item {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
    position: relative;
}

.aps-tl-dot {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 2px solid var(--c-surface);
    flex-shrink: 0;
    z-index: 1;
    margin-top: 2px;
    box-shadow: 0 0 0 2px var(--c-border);
}

.aps-tl-dot.green  { background: var(--c-green); box-shadow: 0 0 0 2px var(--c-green-soft); }
.aps-tl-dot.blue   { background: var(--c-blue);  box-shadow: 0 0 0 2px var(--c-blue-soft); }
.aps-tl-dot.purple { background: var(--c-purple); box-shadow: 0 0 0 2px var(--c-purple-soft); }
.aps-tl-dot.amber  { background: var(--c-amber);  box-shadow: 0 0 0 2px var(--c-amber-soft); }

.aps-tl-body strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-1);
}

.aps-tl-body p {
    font-size: 12px;
    color: var(--c-text-2);
    margin: 3px 0 0;
    line-height: 1.5;
}

.aps-tl-time {
    font-size: 11px;
    color: var(--c-text-3);
    margin-top: 2px;
    display: block;
}

/* ── Chat ────────────────────────────────────────────────────── */
.aps-chat-box {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
    margin-bottom: 14px;
}

.aps-chat-msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.aps-chat-msg.sent {
    background: var(--c-blue);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.aps-chat-msg.received {
    background: var(--c-border-soft);
    color: var(--c-text-1);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.aps-chat-meta {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.65;
}

/* ── Donut chart center ──────────────────────────────────────── */
.aps-donut-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.aps-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.aps-donut-center .dn-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text-1);
    line-height: 1;
}

.aps-donut-center .dn-lbl {
    font-size: 10px;
    color: var(--c-text-3);
    font-weight: 500;
    margin-top: 2px;
}

.aps-legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

.aps-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--c-text-2);
}

.aps-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.aps-legend-item span:last-child {
    margin-left: auto;
    font-weight: 600;
    color: var(--c-text-1);
}

/* ── Notification items ──────────────────────────────────────── */
.aps-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--c-border-soft);
}

.aps-notif-item:last-child { border-bottom: none; }

.aps-notif-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aps-notif-icon svg { width: 14px !important; height: 14px !important; }

.aps-notif-body { flex: 1; min-width: 0; }

.aps-notif-msg {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text-1);
    display: block;
}

.aps-notif-sub {
    font-size: 12px;
    color: var(--c-text-2);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aps-notif-time {
    font-size: 11px;
    color: var(--c-text-3);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Profile form grid ───────────────────────────────────────── */
.aps-form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 700px) {
    .aps-form-2col { grid-template-columns: 1fr; }
}

.aps-form-2col .span-2 { grid-column: 1 / -1; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    #aps-body { flex-direction: column; }

    #aps-sidebar {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        gap: 6px;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
    }

    .aps-nav-section-label { display: none; }

    .aps-nav-item { flex: 0 0 auto; }

    .aps-sidebar-spacer { display: none; }

    .aps-sidebar-user {
        width: 100%;
        margin-top: 4px;
    }

    #aps-main { padding: 20px; }

    #aps-navbar { padding: 0 16px; }
}

@media (max-width: 600px) {
    #aps-main { padding: 16px; }
    .aps-table thead { display: none; }
    .aps-table td { display: block; padding: 6px 12px; }
    .aps-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 10px;
        color: var(--c-text-3);
        display: block;
        margin-bottom: 2px;
    }
}


/* ============================================================
   APS Auth Page — Login / Register
   Full-screen 2-column layout, no WordPress theme wrapper
   ============================================================ */

/* ── Base page shell ─────────────────────────────────────────── */
.aps-auth-body {
    margin: 0 !important;
    padding: 0 !important;
    background: #f0f4f8 !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#aps-auth-page {
    display: flex;
    min-height: 100vh;
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#aps-auth-page.aps-auth-centered {
    justify-content: center;
    align-items: center;
    background: #f0f4f8;
}

#aps-auth-page.aps-auth-centered .aps-auth-right {
    flex: none;
    width: 100%;
    max-width: 480px;
    background: transparent;
    padding: 0;
}

#aps-auth-page *,
#aps-auth-page *::before,
#aps-auth-page *::after {
    box-sizing: border-box;
}

/* ── LEFT PANEL ─────────────────────────────────────────────── */
.aps-auth-left {
    flex: 0 0 46%;
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #0d1b2a;
    overflow: hidden;
}

.aps-auth-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(6, 11, 32, 0.75) 0%,
        rgba(6, 11, 60, 0.60) 50%,
        rgba(0, 12, 40, 0.82) 100%
    );
}

.aps-auth-left-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 44px 44px;
    color: #ffffff;
}

/* Logo */
.aps-auth-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.1);
}

/* Hero text block */
.aps-auth-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 0;
}

.aps-auth-hero h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.2;
}

.aps-auth-hero-sub {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
    line-height: 1.4;
}

.aps-auth-hero-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.72);
    line-height: 1.7;
    margin: 0;
    max-width: 340px;
}

/* Feature bullets */
.aps-auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}

.aps-auth-feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.aps-auth-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    backdrop-filter: blur(8px);
}

.aps-auth-feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}

.aps-auth-feature-item span {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.80);
    letter-spacing: 0.3px;
    line-height: 1.3;
}

/* ── RIGHT PANEL ────────────────────────────────────────────── */
.aps-auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: #f0f4f8;
}

.aps-auth-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.10);
    width: 100%;
    max-width: 480px;
    padding: 40px 44px;
    position: relative;
    overflow: hidden;
}

/* ── Tab switcher ────────────────────────────────────────────── */
.aps-auth-tabs {
    display: flex;
    border-bottom: 2px solid #e8ecf0;
    margin-bottom: 32px;
    gap: 0;
}

.aps-auth-tab {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #8a94a6;
    padding: 0 0 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.aps-auth-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

.aps-auth-tab:hover:not(.active) {
    color: #374151;
}

/* ── Panels ──────────────────────────────────────────────────── */
.aps-auth-panel {
    display: none;
}

.aps-auth-panel.active {
    display: block;
}

/* ── Form header ─────────────────────────────────────────────── */
.aps-auth-form-header {
    margin-bottom: 28px;
    text-align: center;
}

.aps-auth-form-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.aps-auth-form-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ── Messages ────────────────────────────────────────────────── */
.aps-auth-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aps-auth-msg.is-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.aps-auth-msg.is-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #16a34a;
}

/* ── Form fields ─────────────────────────────────────────────── */
.aps-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.aps-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aps-auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.1px;
}

.aps-auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.aps-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.aps-auth-input-wrap .aps-field-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
    stroke: #9ca3af;
    flex-shrink: 0;
}

.aps-auth-input-wrap input,
.aps-auth-input-wrap select {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 44px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}

.aps-auth-input-wrap input::placeholder {
    color: #b0b7c3;
}

.aps-auth-input-wrap input:focus,
.aps-auth-input-wrap select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* Password toggle button */
.aps-pw-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.aps-pw-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.aps-pw-toggle:hover {
    color: #6b7280;
}

/* ── Remember me & Forgot Password row ──────────────────────── */
.aps-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -6px;
}

.aps-auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
}

.aps-auth-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2563eb;
    cursor: pointer;
}

.aps-auth-forgot {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.aps-auth-forgot:hover { color: #1d4ed8; text-decoration: underline; }

/* ── Submit button ───────────────────────────────────────────── */
.aps-auth-submit {
    width: 100%;
    height: 50px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.30);
    margin-top: 6px;
    position: relative;
}

.aps-auth-submit:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.40);
}

.aps-auth-submit:active { transform: scale(0.98); }

.aps-auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.aps-auth-submit .aps-btn-icon {
    width: 17px;
    height: 17px;
    stroke: #ffffff;
}

.aps-auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: aps-spin 0.75s linear infinite;
    display: none;
}

@keyframes aps-spin {
    to { transform: rotate(360deg); }
}

/* ── Divider ─────────────────────────────────────────────────── */
.aps-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: #9ca3af;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.aps-auth-divider::before,
.aps-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ── Social SSO buttons ──────────────────────────────────────── */
.aps-auth-social {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.aps-auth-social.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.aps-auth-social.one-col {
    grid-template-columns: 1fr;
}

.aps-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 44px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    cursor: pointer;
}

.aps-social-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37,99,235,0.10);
    background: #f8faff;
}

.aps-social-btn svg { flex-shrink: 0; }

/* ── Switch link at bottom ───────────────────────────────────── */
.aps-auth-switch {
    text-align: center;
    margin: 24px 0 0;
    font-size: 13.5px;
    color: #6b7280;
}

.aps-auth-switch-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.aps-auth-switch-link:hover { text-decoration: underline; }

/* ── Footer ──────────────────────────────────────────────────── */
.aps-auth-footer {
    background: #f0f4f8;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #e5e7eb;
}

.aps-auth-footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.aps-auth-footer-logo img {
    border-radius: 6px;
    object-fit: contain;
}

.aps-auth-footer p {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    #aps-auth-page {
        flex-direction: column;
    }

    .aps-auth-left {
        flex: 0 0 auto;
        min-height: 220px;
    }

    .aps-auth-left-content {
        padding: 28px 28px 24px;
    }

    .aps-auth-features {
        display: none;
    }

    .aps-auth-hero h1 { font-size: 22px; }

    .aps-auth-right {
        padding: 28px 20px;
    }

    .aps-auth-card {
        padding: 28px 24px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .aps-auth-field-row {
        grid-template-columns: 1fr;
    }

    .aps-auth-social {
        grid-template-columns: 1fr;
    }

    .aps-auth-card {
        padding: 24px 18px;
    }
}

