/* ================= COMMON CORE STYLES (Shared across all admin pages) ================= */

/* SVG Icon Sizing */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

svg {
    max-width: 100%;
    max-height: 100%;
}

/* Core Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main, var(--bg-color, #0f172a));
}

.main-content {
    margin-left: var(--sidebar-width, 260px);
    flex: 1;
    padding: 20px 25px;
    max-width: calc(100% - var(--sidebar-width, 260px));
}

/* Top Navbar */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Avatar */
.avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}

/* Notification Wrapper */
.notif-wrapper {
    position: relative;
    font-size: 20px;
    color: var(--text-secondary, #64748b);
    padding: 8px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.notif-wrapper:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-color, #6366f1);
}

.notif-wrapper:hover .icon {
    fill: var(--accent-color, #6366f1);
}

.notif-wrapper .icon {
    width: 22px;
    height: 22px;
    fill: var(--text-secondary, #94a3b8);
    transition: fill 0.3s ease;
}

/* Bell shake animation when badge is present */
.notif-wrapper:has(.badge) .icon {
    animation: bell-ring 4s ease-in-out infinite;
    transform-origin: top center;
}

.notif-wrapper:has(.badge) {
    background: rgba(239, 68, 68, 0.06);
}

@keyframes bell-ring {
    0%, 100% { transform: rotate(0); }
    2% { transform: rotate(15deg); }
    4% { transform: rotate(-13deg); }
    6% { transform: rotate(10deg); }
    8% { transform: rotate(-8deg); }
    10% { transform: rotate(5deg); }
    12% { transform: rotate(0); }
}

.notif-wrapper .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--bg-main, var(--bg-color, #0f172a));
    animation: badge-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Sidebar badge-red animation */
.badge-red {
    animation: badge-pulse 2s ease-in-out infinite;
}

/* System Status Pill */
.system-status-container {
    margin-top: 4px;
}

.system-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success, #10b981);
    display: inline-block;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ================= SIDEBAR (Common Admin Slider) ================= */
.sidebar {
    width: var(--sidebar-width, 260px);
    background: var(--sidebar-bg, #1e293b);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 1000;
}

.sidebar-brand {
    padding: 25px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
}

.sidebar-brand span {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    letter-spacing: normal;
}

.sidebar-brand span span {
    color: var(--accent-color, #6366f1);
}

.admin-profile-sidebar {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
}

.avatar-wrapper img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: none;
}

.profile-info h4 {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-primary, #f8fafc);
    font-weight: 600;
}

.profile-info p {
    font-size: 0.75rem;
    margin: 0;
    color: var(--text-secondary, #94a3b8);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px;
}

.nav-label {
    padding: 0 25px 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary, #94a3b8);
    font-weight: 700;
    margin-top: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s;
    margin-bottom: 4px;
    position: relative;
}

.nav-item.active {
    background: var(--accent-color, #6366f1);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    /* using blue-indigo */
}

.nav-item i,
.nav-item svg,
.nav-item .icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    margin-right: 0;
    opacity: 1;
    fill: currentColor;
    transition: none;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    /* Using accent with opacity */
    color: var(--accent-color, #6366f1);
}

.badge-red {
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: auto;
    font-weight: 700;
}

.logout-link:hover {
    background-color: var(--danger, #ef4444) !important;
    color: #fff !important;
}

.logout-link:hover .icon {
    fill: #fff !important;
}

/* Base custom scrollbar for sidebar */
.scrollable-sidebar::-webkit-scrollbar {
    width: 6px;
}

.scrollable-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.scrollable-sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Profile indicator for offline mode avatar */
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color, #6366f1) 0%, var(--accent-hover, #4f46e5) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid var(--sidebar-bg, #1e293b);
}