/* ==========================================================================
   BROMIDE PHARMACEUTICALS - Admin Dashboard Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --admin-navy: #0A1E3D;
    --admin-sidebar-bg: #0F2C59;
    --admin-accent: #D32F2F;
    --admin-bg: #F1F5F9;
    --admin-card-bg: #FFFFFF;
    --admin-text: #1E293B;
    --admin-text-light: #64748B;
    --admin-border: #E2E8F0;
    --status-published: #10B981;
    --status-draft: #F59E0B;
    --status-unread: #EF4444;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', sans-serif;
    display: flex;
    min-height: 100vh;
}

/* ADMIN LAYOUT - COMPACT & EFFICIENT */
.admin-sidebar {
    width: 215px;
    background-color: var(--admin-sidebar-bg);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    height: 32px;
}

.sidebar-header h3 {
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu-title {
    padding: 0.35rem 1rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.5rem;
    font-weight: 700;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.815rem;
    transition: all 0.15s ease;
}

.sidebar-menu a i {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border-left: 3px solid var(--admin-accent);
}

.sidebar-user {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* SIDEBAR COLLAPSE & SUBMENU STYLES */
.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.menu-item {
    margin-bottom: 0.15rem;
}

.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.815rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    margin: 0 0.5rem;
    transition: background 0.15s ease, color 0.15s ease;
}
.submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.toggle-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.toggle-left i {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.submenu-arrow {
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    color: rgba(255, 255, 255, 0.5);
}
.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
    color: #FFFFFF;
}

.submenu-list {
    list-style: none;
    padding-left: 1.85rem;
    padding-top: 0.15rem;
    padding-bottom: 0.25rem;
    display: none;
}
.has-submenu.open .submenu-list {
    display: block;
}

.submenu-list a {
    display: block;
    padding: 0.35rem 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.15s ease;
}
.submenu-list a:hover, .submenu-list a.active {
    color: #FFFFFF;
    border-left-color: var(--admin-accent);
    background: rgba(255, 255, 255, 0.08);
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.85rem;
    margin: 0 0.5rem;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.815rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.menu-link i {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}
.menu-link:hover, .menu-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    border-left: 3px solid var(--admin-accent);
}

/* SIDEBAR COLLAPSED MODE (ICON ONLY) */
body.sidebar-collapsed .admin-sidebar {
    width: 60px;
}
body.sidebar-collapsed .admin-main {
    margin-left: 60px;
}
body.sidebar-collapsed .sidebar-brand-title,
body.sidebar-collapsed .link-text,
body.sidebar-collapsed .submenu-arrow,
body.sidebar-collapsed .submenu-list,
body.sidebar-collapsed .user-info {
    display: none !important;
}
body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}
body.sidebar-collapsed .submenu-toggle,
body.sidebar-collapsed .menu-link {
    justify-content: center;
    padding: 0.6rem 0;
    margin: 0 0.25rem;
}
body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

/* MAIN CONTENT */
.admin-main {
    margin-left: 215px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.admin-sidebar {
    width: 215px;
    background-color: var(--admin-sidebar-bg);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width 0.25s ease;
}

.admin-topbar {
    background-color: #FFFFFF;
    height: 52px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--admin-border);
}

.admin-page-title {
    font-size: 1.15rem;
    color: var(--admin-navy);
    font-weight: 700;
}

.admin-content {
    padding: 1.25rem;
    flex-grow: 1;
}

/* KPI CARDS - COMPACT OVERVIEW */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.kpi-card {
    background: #FFFFFF;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-navy);
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--admin-text-light);
    margin-top: 0.15rem;
    font-weight: 500;
}

.kpi-card i {
    font-size: 1.5rem !important;
}

/* TABLES & BADGES */
.admin-card {
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    padding: 1.15rem;
    margin-bottom: 1.25rem;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.admin-table th, .admin-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    background-color: #F8FAFC;
    color: var(--admin-text-light);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge {
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-published { background: #D1FAE5; color: #065F46; }
.badge-draft { background: #FEF3C7; color: #92400E; }
.badge-unread { background: #FEE2E2; color: #991B1B; }

/* ACTION BUTTON UTILITIES */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-right: 0.25rem;
}

.btn-action.edit {
    background-color: #0F2C59;
    color: #FFFFFF;
}
.btn-action.edit:hover {
    background-color: #153C78;
}

.btn-action.delete {
    background-color: #D32F2F;
    color: #FFFFFF;
}
.btn-action.delete:hover {
    background-color: #B71C1C;
}

.btn-action.view {
    background-color: #0284C7;
    color: #FFFFFF;
}
.btn-action.view:hover {
    background-color: #0369A1;
}

/* FORMS & MODALS */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--admin-sidebar-bg);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: #FFFFFF;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
}

/* MEDIA LIBRARY GRID */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.media-item {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #F8FAFC;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item img {
    max-height: 100%;
    object-fit: cover;
}

/* TOAST MESSAGES */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-msg {
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    color: #FFFFFF;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: fadeIn 0.3s ease;
}

.toast-success { background-color: #10B981; }
.toast-error { background-color: #EF4444; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
