/* Ipil Academy — Admin Panel Styles (shares tokens with style.css) */

body.admin-body {
    background: var(--ice);
    font-family: var(--font-body);
}

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

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--ink);
    color: #C8D8ED;
    padding: 20px 18px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
    flex-shrink: 0;
    z-index: 100;
}
.admin-sidebar::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.admin-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }
.admin-sidebar .brand { color: var(--white); font-size: 17px; margin-bottom: 20px; }
.admin-sidebar .brand .seal { color: var(--sky); width: 28px; height: 28px; }
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    color: #B9CEE8;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.admin-nav a.active { background: var(--royal); color: var(--white); }
.admin-nav .nav-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6D87A8;
    margin: 14px 0 4px 12px;
}

/* Main area */
.admin-main { flex: 1; min-width: 0; margin-left: 250px; }
.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-topbar h1 { font-size: 20px; }
.admin-content { padding: 32px; }

.admin-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.admin-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--royal); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.kpi-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.kpi-card .kpi-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: #EAF1FB; color: var(--royal);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px; font-size: 18px;
}
.kpi-num { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.kpi-label { font-size: 13px; color: var(--slate); margin-top: 2px; }

/* Panels / tables */
.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 26px;
}
.panel-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-head h3 { font-size: 16px; }
.panel-body { padding: 24px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
    text-align: left;
    padding: 12px 24px;
    background: var(--ice);
    color: var(--slate);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--line);
}
.data-table td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table img.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }

.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge-active, .badge-valid, .badge-completed { background: #EFF8F1; color: var(--success); }
.badge-inactive, .badge-revoked, .badge-dropped { background: #FBEEEC; color: var(--danger); }
.badge-ongoing { background: #FFF6E0; color: #9A6B00; }

.action-icons { display: flex; gap: 10px; }
.action-icons a, .action-icons button {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--white); color: var(--slate);
    cursor: pointer; font-size: 14px;
}
.action-icons a:hover { border-color: var(--royal); color: var(--royal); }
.action-icons .del:hover { border-color: var(--danger); color: var(--danger); }

/* Forms */
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-form .form-group { margin-bottom: 18px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.admin-form .form-control { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; background: var(--ice); font-family: var(--font-body); }
.admin-form textarea.form-control { min-height: 120px; }
.admin-form .form-control:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px rgba(30,86,160,0.12); }
.form-hint { font-size: 12px; color: var(--slate); margin-top: 5px; }

.template-picker { display: flex; gap: 14px; flex-wrap: wrap; }
.template-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.template-option:hover { border-color: var(--sky); }
.template-option.selected { border-color: var(--royal); background: #EAF1FB; }
.template-swatch { display: flex; }
.template-swatch span { width: 16px; height: 16px; border-radius: 50%; margin-left: -6px; border: 2px solid var(--white); }
.template-swatch span:first-child { margin-left: 0; }
.template-label { font-size: 13px; font-weight: 600; color: var(--ink); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--slate);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.page-link:hover { border-color: var(--royal); color: var(--royal); }
.page-link.active { background: var(--royal); border-color: var(--royal); color: var(--white); }
.page-link.disabled { color: #C3CEDA; cursor: not-allowed; }
.page-link.disabled:hover { border-color: var(--line); color: #C3CEDA; }
.page-ellipsis { color: var(--slate); padding: 0 4px; font-size: 13px; }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ink), #123A6E);
}
.login-card {
    width: 380px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}
.login-card .seal { width: 44px; height: 44px; color: var(--royal); margin-bottom: 14px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card p.sub { color: var(--slate); font-size: 14px; margin-bottom: 26px; }

.admin-menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; font-size: 18px; color: var(--ink); cursor: pointer; }
.admin-sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(11,37,69,0.5); z-index: 149; }
.admin-sidebar-backdrop.show { display: block; }

@media (max-width: 980px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-form .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .admin-menu-toggle { display: block; }
    .admin-main { margin-left: 0; }
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 30px rgba(0,0,0,0.25);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { padding: 18px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .admin-topbar { padding: 14px 18px; }
    .admin-topbar h1 { font-size: 17px; }
    .admin-user span { display: none; }
    .panel-body { padding: 18px; }
    .panel-head { flex-wrap: wrap; gap: 10px; }
}

/* Responsive tables: scroll horizontally instead of breaking layout */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { min-width: 640px; }
