/* ══════════════════════════════════════════════════
   InnerCat Admin — Design System v5 (Pixel-Perfect)
   ══════════════════════════════════════════════════ */

/* ── Dark Mode (default) ── */
.dark-mode {
    --ic-accent: #d4ff3c;
    --ic-accent-hover: #c0eb2e;
    --ic-bg: #000000;
    --ic-surface: #121212;
    --ic-surface-hover: #1e1e1e;
    --ic-text: #ffffff;
    --ic-text-muted: #a0a0a0;
    --ic-border: rgba(255, 255, 255, 0.08);
    --ic-topbar-bg: #0a0a0a;
    --ic-sidebar-bg: #0a0a0a;
    --ic-success: #10b981;
    --ic-danger: #ef4444;
    --ic-btn-secondary-bg: #2a2a2a;
    --ic-btn-secondary-text: #e0e0e0;
    --ic-btn-secondary-hover: #3a3a3a;
}

/* ── Light Mode ── */
.light-mode {
    --ic-accent: #9ab800;
    --ic-accent-hover: #8aa500;
    --ic-bg: #f4f5f7;
    --ic-surface: #ffffff;
    --ic-surface-hover: #f0f0f0;
    --ic-text: #111111;
    --ic-text-muted: #555555;
    --ic-border: rgba(0, 0, 0, 0.10);
    --ic-topbar-bg: #ffffff;
    --ic-sidebar-bg: #ffffff;
    --ic-success: #059669;
    --ic-danger: #dc2626;
    --ic-btn-secondary-bg: #e2e2e2;
    --ic-btn-secondary-text: #111111;
    --ic-btn-secondary-hover: #d0d0d0;
}

body {
    background-color: var(--ic-bg);
    color: var(--ic-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: background-color 0.15s, color 0.15s;
    margin: 0;
}

/* ── Material Icons helper ── */
.mso {
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    vertical-align: middle;
}

/* ══════════ TOP BAR ══════════ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
    height: 56px;
    padding: 0 2rem;
    border-bottom: 1px solid var(--ic-border);
    background: var(--ic-topbar-bg);
    position: sticky;
    top: 0;
    z-index: 200;
}

.topbar>* {
    flex-shrink: 0;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ic-accent);
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.avatar-circle:hover {
    box-shadow: 0 0 0 3px rgba(212, 255, 60, 0.2);
}

.avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ic-accent);
    color: #000;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.avatar-initials:hover {
    box-shadow: 0 0 0 3px rgba(212, 255, 60, 0.2);
}

.topbar-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ic-text-muted);
    padding: 6px;
    border-radius: 8px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.topbar-btn:hover {
    background: var(--ic-surface-hover);
    color: var(--ic-accent);
}

/* ── Avatar Dropdown (Google Style) ── */
.avatar-dropdown-wrapper {
    position: relative;
    z-index: 450;
    display: inline-flex;
    align-items: center;
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--ic-surface);
    border: 1px solid var(--ic-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    z-index: 500;
    padding: 0;
    animation: dropdownFade 0.12s ease-out;
    overflow: hidden;
}

.avatar-dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ic-border);
}

.avatar-dropdown-header .dd-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ic-text);
    margin: 0;
    line-height: 1.3;
}

.avatar-dropdown-header .dd-email {
    font-size: 0.8rem;
    color: var(--ic-text-muted);
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-dropdown-body {
    padding: 0.5rem 0;
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.25rem;
    font-size: 0.88rem;
    color: var(--ic-text);
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
}

.avatar-dropdown-item:hover {
    background: var(--ic-surface-hover);
}

.avatar-dropdown-item .material-symbols-outlined {
    font-size: 20px;
    color: var(--ic-text-muted);
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════ SIDEBAR ══════════ */
.sidebar {
    background: var(--ic-sidebar-bg);
    min-height: 100vh;
    padding: 1.25rem 0;
    border-right: 1px solid var(--ic-border);
}

.sidebar .brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ic-accent);
    padding: 0 1.25rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    /* NO border-bottom */
}

.sidebar .brand .brand-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.sidebar .nav-link {
    color: var(--ic-text-muted);
    padding: 0.65rem 1.25rem;
    transition: all 0.12s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--ic-text);
    background: rgba(212, 255, 60, 0.06);
    border-left-color: var(--ic-accent);
}

/* ══════════ MAIN ══════════ */
.main-content {
    background: var(--ic-bg);
    min-height: 100vh;
    padding: 0;
}

.main-body {
    padding: 1.5rem 2rem;
}

/* ══════════ CARDS ══════════ */
.card-dark {
    background: var(--ic-surface);
    border: 1px solid var(--ic-border);
    border-radius: 10px;
}

/* ══════════ TABLES ══════════ */
.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--ic-border);
    color: var(--ic-text);
}

.table-dark-custom thead th {
    color: var(--ic-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--ic-border);
}

.table-dark-custom tbody td {
    color: var(--ic-text);
    vertical-align: middle;
    padding: 0.8rem 0.75rem;
}

.table-dark-custom tbody tr {
    transition: background 0.1s;
}

.table-dark-custom tbody tr:hover {
    background: var(--ic-surface-hover);
}

/* Table action buttons — no borders, no background, inherits text color */
.btn-action-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
    cursor: pointer;
    color: var(--ic-text-muted);
    padding: 4px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.btn-action-icon:hover {
    background: var(--ic-surface-hover) !important;
    color: var(--ic-accent);
}

.btn-action-icon.danger:hover {
    color: var(--ic-danger);
}

/* ══════════ BADGES ══════════ */
.badge-active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--ic-success);
    padding: 0.25em 0.65em;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.8rem;
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: var(--ic-danger);
    padding: 0.25em 0.65em;
    border-radius: 5px;
    font-weight: 500;
    font-size: 0.8rem;
}

/* ══════════ BUTTONS ══════════ */
.btn-primary-ic {
    background-color: var(--ic-accent);
    color: #000000;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.3rem;
    border-radius: 6px;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary-ic:hover {
    background-color: var(--ic-accent-hover);
    color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 255, 60, 0.25);
}

.btn-primary-ic:disabled {
    opacity: 0.5;
    transform: none;
    box-shadow: none;
}

/* Secondary button — works in BOTH modes */
.btn-secondary-ic {
    background: var(--ic-btn-secondary-bg);
    color: var(--ic-btn-secondary-text);
    font-weight: 500;
    border: none;
    padding: 0.5rem 1.3rem;
    border-radius: 6px;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-secondary-ic:hover {
    background: var(--ic-btn-secondary-hover);
    color: var(--ic-btn-secondary-text);
}

/* Outline accent */
.btn-outline-accent {
    color: var(--ic-accent);
    border: 1px solid var(--ic-accent);
    background: transparent;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-outline-accent:hover {
    background: rgba(212, 255, 60, 0.08);
    color: var(--ic-accent);
}

/* Outline danger */
.btn-outline-danger {
    color: var(--ic-danger);
    border: 1px solid var(--ic-danger);
    background: transparent;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* ══════════ FORM CONTROLS ══════════ */
.form-control-dark {
    background: var(--ic-bg);
    border: 1px solid var(--ic-border);
    color: var(--ic-text);
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
}

.form-control-dark:focus {
    background: var(--ic-bg);
    border-color: var(--ic-accent);
    color: var(--ic-text);
    box-shadow: 0 0 0 3px rgba(212, 255, 60, 0.1);
}

.form-control-dark::placeholder {
    color: var(--ic-text-muted);
}

/* Disabled / readonly inputs — good contrast in both modes */
.dark-mode input:disabled,
.dark-mode input[readonly],
.dark-mode select:disabled,
.dark-mode textarea:disabled,
.dark-mode .form-control-dark:disabled,
.dark-mode .form-control-dark[readonly] {
    background-color: #2a2a2a !important;
    color: #a0a0a0 !important;
    border-color: #444 !important;
    opacity: 1;
}

.light-mode input:disabled,
.light-mode input[readonly],
.light-mode select:disabled,
.light-mode textarea:disabled,
.light-mode .form-control-dark:disabled,
.light-mode .form-control-dark[readonly] {
    background-color: #eaeaea !important;
    color: #666 !important;
    border-color: #ccc !important;
    opacity: 1;
}

/* Toggle switch accent */
.form-check-input:checked {
    background-color: var(--ic-accent);
    border-color: var(--ic-accent);
}

/* ══════════ PAGE HEADER ══════════ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header p {
    color: var(--ic-text-muted);
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* ══════════ MODAL ══════════ */
.modal-backdrop-ic {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content-ic {
    background: var(--ic-surface);
    border: 1px solid var(--ic-border);
    border-radius: 12px;
    padding: 1.75rem;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.15s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════ DETAIL PAGE ══════════ */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--ic-border);
}

.detail-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-header .back-link {
    color: var(--ic-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.1s;
}

.detail-header .back-link:hover {
    color: var(--ic-accent);
}

.info-card {
    border: 1px solid var(--ic-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--ic-surface);
}

.info-card h6 {
    color: var(--ic-accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-card .info-row {
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}

.info-card .info-row strong {
    color: var(--ic-text-muted);
    font-weight: 500;
    margin-right: 0.5rem;
}

/* ══════════ COMPONENT TOGGLE ══════════ */
.component-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--ic-border);
}

.component-toggle-row:last-child {
    border-bottom: none;
}

.component-toggle-row .toggle-label {
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.component-toggle-row .toggle-label small {
    color: var(--ic-text-muted);
}

/* ══════════ NOTIFICATION BELL ══════════ */
.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ══════════ UTILITIES ══════════ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ══════════ BLUEPRINT DROP ZONE ══════════ */
.blueprint-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 110px;
    padding: 1.25rem 1rem;
    border: 1.5px dashed rgba(212, 255, 60, 0.4);
    border-radius: 8px;
    background: rgba(212, 255, 60, 0.03);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    overflow: hidden;
}

.blueprint-dropzone:hover {
    border-color: rgba(212, 255, 60, 0.75);
    background: rgba(212, 255, 60, 0.06);
}

.blueprint-dropzone--uploading {
    border-color: rgba(212, 255, 60, 0.2);
    background: rgba(212, 255, 60, 0.02);
    pointer-events: none;
}

/* Light mode adjustments */
.light-mode .blueprint-dropzone {
    border-color: rgba(154, 184, 0, 0.4);
    background: rgba(154, 184, 0, 0.03);
}

.light-mode .blueprint-dropzone:hover {
    border-color: rgba(154, 184, 0, 0.75);
    background: rgba(154, 184, 0, 0.06);
}