/* ============================================
   GRC Admin Panel Stylesheet
   ============================================ */
:root {
    --navy-950: #0B1957;
    --navy-900: #0B1957;
    --navy-800: #0B1957;
    --bg-sidebar: #0B1957;
    --bg-main: #0B1957;
    --bg-card: #0B1957;
    --bg-input: rgba(255, 255, 255, 0.04);
    --emerald-600: #FFDBD1;
    --emerald-500: #FFDBD1;
    --emerald-400: #FFDBD1;
    --gold-400: #FFDBD1;
    --gold-300: #FFDBD1;
    --red-500: #ef4444;
    --blue-400: #60a5fa;
    --text-primary: #f0f6ff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 219, 209, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: all 0.2s ease;
    --sidebar-width: 240px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
}

.btn-md {
    padding: 0.6rem 1.25rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
    color: #0B1957;
    box-shadow: 0 4px 16px rgba(255, 219, 209, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, var(--red-500));
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--red-500), #f87171);
}

.btn-outline-gold {
    background: transparent;
    border: 1px solid rgba(255, 219, 209, 0.4);
    color: var(--gold-400);
}

.btn-outline-gold:hover {
    background: rgba(255, 219, 209, 0.1);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-950);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 219, 209, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 219, 209, 0.06) 0%, transparent 50%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-shield {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-logo h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.875rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--emerald-500);
    background: rgba(255, 219, 209, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 219, 209, 0.1);
}

.form-group select option {
    background: var(--navy-900);
    color: var(--text-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--emerald-500);
    cursor: pointer;
}

.form-check span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.875rem;
    font-size: 0.82rem;
    color: #fca5a5;
    text-align: center;
}

.back-link {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--emerald-400);
}

/* ============================================
   ADMIN APP LAYOUT
   ============================================ */
.admin-app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.sidebar-logo-icon {
    font-size: 1.2rem;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(255, 219, 209, 0.12);
    color: var(--emerald-400);
}

.sidebar-link-muted {
    color: var(--text-muted);
}

.sidebar-link-danger {
    color: #fca5a5;
}

.sidebar-link-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--emerald-600);
    color: #0B1957;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 50px;
}

.sidebar-footer {
    padding: 1rem 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-user {
    padding: 0.6rem 0.875rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Header & Main ---- */
.admin-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}

.header-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.admin-content {
    flex: 1;
    padding: 1.75rem;
    overflow-y: auto;
}

/* ============================================
   DASHBOARD PAGE
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
}

.stat-card-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.stat-card-number {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--emerald-400), var(--gold-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.quick-actions-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ============================================
   TABLE
   ============================================ */
.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.table-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .td-title {
    color: var(--text-primary);
    font-weight: 600;
}

.tbl-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.badge-active {
    background: rgba(255, 219, 209, 0.15);
    color: var(--emerald-400);
    border: 1px solid rgba(255, 219, 209, 0.3);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-published {
    background: rgba(255, 219, 209, 0.15);
    color: var(--emerald-400);
    border: 1px solid rgba(255, 219, 209, 0.3);
}

.badge-draft {
    background: rgba(255, 219, 209, 0.1);
    color: var(--gold-400);
    border: 1px solid rgba(255, 219, 209, 0.2);
}

.badge-featured {
    background: rgba(255, 219, 209, 0.1);
    color: var(--gold-400);
    border: 1px solid rgba(255, 219, 209, 0.2);
}

.row-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    color: var(--text-secondary);
}

.action-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.action-btn-edit {
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--blue-400);
}

.action-btn-edit:hover {
    background: rgba(59, 130, 246, 0.1);
}

.action-btn-delete {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.action-btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Contact read/unread */
.contact-unread td {
    color: var(--text-primary);
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--emerald-500);
    border-radius: 50%;
    margin-right: 0.4rem;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 11, 20, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
}

.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.25s ease;
    border: 1px solid;
    max-width: 320px;
}

.toast-success {
    background: rgba(255, 219, 209, 0.15);
    border-color: rgba(255, 219, 209, 0.3);
    color: var(--emerald-400);
}

.toast-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.toast-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--blue-400);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 1rem;
}

@keyframes shimmer {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .admin-app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        bottom: 0;
        width: var(--sidebar-width);
        z-index: 500;
        transition: left 0.25s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
    }

    .menu-toggle {
        display: block;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.6rem 0.75rem;
    }
}