/* ==========================================================================
   PharmPro — Alerts Page Styles
   Matches home.css variable system exactly
   ========================================================================== */

/* --- Page Title Bar (same as sales.css) --- */
.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title-left h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title-left h2 i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.page-title-left .current-date {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 3px;
}

/* --- Summary Cards Row --- */
.alerts-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.summary-card {
    padding: 22px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 18px;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card.low-stock {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.summary-card.expiring-soon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.22);
}

.summary-card.expired-card {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.22);
}

.summary-card:hover {
    transform: translateY(-3px);
    filter: brightness(1.06);
}

.summary-icon {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon i {
    font-size: 1.5rem;
}

.summary-info h3 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 2px 0;
    letter-spacing: -0.5px;
    line-height: 1;
}

.summary-info p {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    opacity: 0.95;
}

.summary-info span {
    font-size: 0.72rem;
    opacity: 0.70;
    font-weight: 400;
}

/* --- Section Headers --- */
.alert-section {
    margin-bottom: 8px;
}

.section-header {
    margin-bottom: 16px;
}

.alert-section h2 {
    font-size: 1rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    margin: 0;
}

.alert-section h2 i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Section count badge */
.section-badge {
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    margin-left: 4px;
}

.section-badge.expiry-badge {
    background: #f59e0b;
}

/* --- Alert Items Grid --- */
.alerts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

/* --- Individual Alert Card --- */
.alert-item {
    background: var(--white);
    padding: 16px 18px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.alert-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Expiry-specific border colors */
.alert-item.expiring {
    border-left-color: #f59e0b;
}

.alert-item.expired {
    border-left-color: #ef4444;
}

.alert-info {
    flex: 1;
    min-width: 0;
}

.alert-info h4 {
    margin: 0 0 4px 0;
    color: var(--secondary-color);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-info p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
}

.alert-info .exp-date {
    margin-top: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.alert-info .exp-date.expiring { color: #d97706; }
.alert-info .exp-date.expired  { color: #ef4444; }

/* --- Badges --- */
.qty-badge {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.78rem;
    border: 1px solid #dbeafe;
    white-space: nowrap;
    flex-shrink: 0;
}

.qty-badge.warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.qty-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* --- Empty State --- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--success);
    margin-bottom: 10px;
    display: block;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

/* ==========================================================================
   BELL ICON — for index.html header (injected by home.js)
   ========================================================================== */
.bell-wrapper {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    transition: background 0.15s ease;
}

.bell-wrapper:hover {
    background: var(--hover-bg);
}

.bell-wrapper i {
    font-size: 1.15rem;
    color: var(--secondary-color);
}

.bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    line-height: 1;
}

/* Bell dropdown popup */
.bell-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: 300px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(15,23,42,0.12);
    border: 1px solid var(--border-color);
    z-index: 999;
    overflow: hidden;
    display: none;
}

.bell-dropdown.open {
    display: block;
}

.bell-dropdown-header {
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bell-dropdown-body {
    max-height: 240px;
    overflow-y: auto;
}

.bell-drop-item {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: background 0.1s;
}

.bell-drop-item:hover {
    background: var(--primary-light);
}

.bell-drop-item i {
    margin-top: 2px;
    flex-shrink: 0;
}

.bell-drop-item i.low  { color: var(--primary-color); }
.bell-drop-item i.exp  { color: #f59e0b; }
.bell-drop-item i.dead { color: #ef4444; }

.bell-drop-item .item-text strong {
    display: block;
    font-weight: 600;
}

.bell-drop-item .item-text span {
    color: #64748b;
    font-size: 11px;
}

.bell-dropdown-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.bell-dropdown-footer a {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.bell-dropdown-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .alerts-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .alerts-list {
        grid-template-columns: 1fr;
    }

    .bell-dropdown {
        width: 260px;
        right: -50px;
    }
}