@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap');

:root {
    --ig-black: #000000;
    --ig-white: #ffffff;
    --ig-border-color: #dbdbdb;
    --ig-text-muted: #8e8e8e;
    --ig-bg: #fafafa;
    --ig-danger: #d9534f;
    --ig-success: #28a745;
    --ig-warning: #b8860b;
}

* { box-sizing: border-box; }

body {
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
    background: var(--ig-bg);
    color: #222;
}

a { color: inherit; }

.form-control {
    font-family: inherit;
}

/* ---- Auth pages (setup/login) — mirrors vendor.css's .ig-auth --------------- */

.ig-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ig-auth-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid var(--ig-border-color);
    border-radius: 12px;
    padding: 36px 32px;
    text-align: center;
}

.ig-auth-box h1 {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 4px;
}

.ig-auth-sub {
    color: var(--ig-text-muted);
    font-size: .85em;
    margin-bottom: 24px;
}

.ig-auth-box .form-group {
    text-align: left;
    margin-bottom: 14px;
}

.ig-auth-box label {
    font-size: .8em;
    color: var(--ig-text-muted);
}

.ig-btn {
    background: var(--ig-black);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: .9em;
    font-weight: 600;
    cursor: pointer;
}

.ig-auth-box .ig-btn {
    width: 100%;
    padding: 10px 0;
}

.ig-auth-alt {
    font-size: .82em;
    color: var(--ig-text-muted);
    margin-top: 18px;
    margin-bottom: 0;
}

.ig-auth-alt a {
    color: var(--ig-black);
    font-weight: 600;
    text-decoration: none;
}

.password-hint {
    font-size: .75em;
    color: #aeaeae;
    margin-top: 4px;
    margin-bottom: 0;
}

.alert {
    display: none;
    box-shadow: 0 10px 10px 0 rgba(0, 0, 0, .15);
}

.alert p {
    margin-bottom: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 13px;
}

.alert-container {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

/* ---- Shell: sidebar + main ------------------------------------------------- */

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

.admin-sidebar {
    width: 230px;
    flex-shrink: 0;
    border-right: 1px solid var(--ig-border-color);
    background: #fff;
    padding: 20px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .brand {
    font-size: 1.1em;
    font-weight: 700;
    padding: 8px 12px 24px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #222;
    font-size: .9em;
    font-weight: 500;
    margin-bottom: 2px;
}

.admin-nav-item i {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.admin-nav-item:hover {
    background: var(--ig-bg);
}

.admin-nav-item.active {
    font-weight: 700;
    background: var(--ig-bg);
}

.admin-nav-divider {
    border-top: 1px solid var(--ig-border-color);
    margin: 14px 8px;
}

.admin-nav-section-label {
    font-size: .7em;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ig-text-muted);
    padding: 8px 12px 4px;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 28px 36px 60px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-topbar h1 {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
}

.admin-user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .85em;
    color: var(--ig-text-muted);
}

.admin-user-menu a {
    text-decoration: underline;
    cursor: pointer;
}

.admin-bell {
    position: relative;
    font-size: 1.2em;
    color: #222;
    text-decoration: none;
    cursor: pointer;
}

.admin-bell .dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ig-danger);
    display: none;
}

.admin-bell.has-unread .dot {
    display: block;
}

/* ---- Cards ------------------------------------------------------------------ */

.admin-card {
    background: #fff;
    border: 1px solid var(--ig-border-color);
    border-radius: 12px;
    padding: 20px;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat-card strong {
    display: block;
    font-size: 1.7em;
    font-weight: 700;
}

.admin-stat-card span {
    font-size: .8em;
    color: var(--ig-text-muted);
}

/* ---- Tables ------------------------------------------------------------------ */

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .87em;
}

.admin-table th {
    text-align: left;
    font-size: .72em;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ig-text-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--ig-border-color);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

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

.admin-table tr:hover td {
    background: var(--ig-bg);
}

.admin-empty-row td {
    text-align: center;
    color: var(--ig-text-muted);
    padding: 40px 12px;
}

/* ---- Badges ------------------------------------------------------------------ */

.admin-badge {
    display: inline-block;
    font-size: .74em;
    font-weight: 600;
    padding: .25rem .7rem;
    border-radius: 2rem;
}

.admin-badge--active { background: #EEFCF3; color: var(--ig-success); }
.admin-badge--inactive { background: #f0f0f0; color: #666; }
.admin-badge--blocked { background: #FFEEEB; color: var(--ig-danger); }
.admin-badge--pending { background: #FFF5EB; color: var(--ig-warning); }
.admin-badge--complete { background: #EEFCF3; color: var(--ig-success); }

/* ---- Buttons / forms ----------------------------------------------------------- */

.admin-btn-outline {
    background: #efefef;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: .82em;
    font-weight: 600;
    cursor: pointer;
}

.admin-btn-sm {
    background: var(--ig-black);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: .8em;
    font-weight: 600;
    cursor: pointer;
}

.admin-btn-danger {
    background: var(--ig-danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: .8em;
    font-weight: 600;
    cursor: pointer;
}

.admin-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    align-items: center;
}

.admin-toolbar select,
.admin-toolbar input[type="search"] {
    border: 1px solid var(--ig-border-color);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: .85em;
    font-family: inherit;
}

/* ---- Modal (shared with confirmModal) ----------------------------------------- */

.ig-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.ig-modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 0;
    max-width: 340px;
    width: 100%;
    text-align: center;
}

.ig-modal-message {
    font-size: .9em;
    line-height: 1.5;
    margin-bottom: 24px;
}

.ig-modal-actions {
    display: flex;
    border-top: 1px solid var(--ig-border-color);
    margin: 0 -24px;
}

.ig-modal-actions button {
    flex: 1;
    border: none;
    background: none;
    padding: 14px 0;
    font-size: .85em;
    font-weight: 600;
    cursor: pointer;
}

.ig-modal-cancel {
    border-right: 1px solid var(--ig-border-color);
    color: #333;
}

.ig-modal-confirm--danger {
    color: var(--ig-danger);
}

/* ---- Slide-over panel (add/edit forms) ----------------------------------------- */

.admin-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 9000;
    display: none;
}

.admin-panel-overlay.active {
    display: block;
}

.admin-panel {
    position: fixed;
    top: 0;
    right: -620px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 9001;
    overflow-y: auto;
    padding: 24px;
    transition: right .25s ease;
}

.admin-panel.active {
    right: 0;
}

.admin-panel h2 {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 20px;
}

.admin-panel .form-group label {
    font-size: .8em;
    font-weight: 600;
    color: #333;
}

/* ---- Responsive ------------------------------------------------------------------ */

@media screen and (max-width: 900px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: relative; display: flex; overflow-x: auto; padding: 10px; }
    .admin-sidebar .brand { display: none; }
    .admin-nav-item { flex-shrink: 0; }
    .admin-nav-divider, .admin-nav-section-label { display: none; }
    .admin-main { padding: 20px 16px 50px; }
}