/* ============================================================
   MRB Admin Dashboard — Microsoft 365 / Google Sheets Theme
   Office Light Mode with Fluent Design System Accents
   ============================================================ */

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

* {
    box-sizing: border-box;
}

:root {
    /* Core palette — Fluent Design */
    --bg-dark: #f3f3f3;
    --card-bg: #ffffff;
    --accent-blue: #0078d4;
    --accent-blue-light: #deecf9;
    --accent-green: #107c10;
    --text-primary: #1f1f1f;
    --text-sidebar: #605e5c;
    --sidebar-bg: #2b2b6b;
    --sidebar-hover: rgba(255, 255, 255, 0.12);
    --sidebar-active: rgba(255, 255, 255, 0.18);
    --border-color: #e1dfdd;
    --border-focus: #0078d4;
    --glass-blur: none; /* removed in light mode */
    --transition-standard: all 0.18s ease;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.06);
    --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.12);
    --input-bg: #ffffff;
    --input-border: #d1d1d1;
    --row-hover: #f0f6ff;
    --row-alt: #fafafa;
}

/* ─── Demo Banner ─────────────────────────────────────────── */
.demo-banner {
    background: #fff4ce;
    color: #7d5c00;
    text-align: center;
    padding: 9px 20px;
    font-size: 0.83rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #f0c040;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 3000;
}

.demo-banner strong {
    color: #8a6914;
    text-transform: uppercase;
    margin-right: 6px;
    font-weight: 700;
}

/* ─── Base ────────────────────────────────────────────────── */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ──────────────────────────────────────────────── */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: none;
    padding: 0;
    position: fixed;
    top: 36px;
    height: calc(100% - 36px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Sidebar brand area */
.sidebar h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    padding: 1.25rem 1.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    letter-spacing: 0.02em;
}

.sidebar h2 svg {
    color: #79b8f3 !important;
    flex-shrink: 0;
}

.sidebar h2 span {
    font-size: 0.95rem;
}

/* Nav section label */
.sidebar nav {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li {
    margin: 1px 0;
}

.sidebar nav ul li a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-standard);
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar nav ul li a:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
    border-left-color: rgba(255, 255, 255, 0.4);
}

.sidebar nav ul li a.active {
    background: var(--sidebar-active);
    color: #ffffff;
    border-left-color: #79b8f3;
    font-weight: 600;
}

.sidebar nav ul li a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar nav ul li a.active svg,
.sidebar nav ul li a:hover svg {
    opacity: 1;
}

/* ─── Main Content ────────────────────────────────────────── */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 0;
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 36px);
}

/* ─── Header / Toolbar ────────────────────────────────────── */
header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    position: sticky;
    top: 36px;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    justify-content: flex-end;
}

header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    -webkit-background-clip: unset;
    letter-spacing: -0.01em;
}

/* ─── Content Padding ─────────────────────────────────────── */
main.main-content > section,
main.main-content > .data-table-container {
    margin: 1.5rem 2rem;
}

/* ─── Filter Group & Search ───────────────────────────────── */
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-end;
    max-width: 800px;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 260px;
}

.search-container svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sidebar);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-container input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-standard);
}

.search-container input::placeholder {
    color: #a19f9d;
}

.search-container input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* ─── Filter Dropdowns ────────────────────────────────────── */
.filter-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-dropdown svg {
    position: absolute;
    left: 0.6rem;
    color: var(--text-sidebar);
    pointer-events: none;
    width: 14px;
    height: 14px;
}

.filter-dropdown select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.5rem 1.75rem 0.5rem 2rem;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: var(--transition-standard);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23605e5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.filter-dropdown select:hover {
    border-color: var(--accent-blue);
}

.filter-dropdown select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.filter-dropdown select option {
    background-color: #ffffff;
    color: #1f1f1f;
}

/* ─── Avatar / User ───────────────────────────────────────── */
.user-profile .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #ffffff;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition-standard);
}

.user-profile .avatar:hover {
    opacity: 0.85;
}

.btn-icon {
    padding: 0.45rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
}

.btn-icon:hover {
    background: #f3f3f3;
    border-color: var(--border-color);
}

/* ─── Dashboard Category Grid ─────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.5rem 2rem;
}

.category-card {
    background: var(--card-bg);
    backdrop-filter: none;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-standard);
    box-shadow: var(--shadow-card);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-blue);
    opacity: 0;
    transition: var(--transition-standard);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #c8c6c4;
}

.category-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.category-card h3 {
    margin: 0 0 0.35rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-card .total-count {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.category-card .category-label {
    font-size: 0.78rem;
    color: var(--text-sidebar);
    margin: 0.2rem 0 0;
}

/* ─── Data Table Container ────────────────────────────────── */
.data-table-container {
    background: var(--card-bg);
    backdrop-filter: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    overflow-x: auto;
    box-shadow: var(--shadow-card);
    margin: 1.5rem 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

thead {
    background: #f3f3f3;
    border-bottom: 2px solid var(--border-color);
}

th {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: none;
    color: var(--text-sidebar);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    user-select: none;
}

th:first-child { border-radius: 8px 0 0 0; }
th:last-child  { border-radius: 0 8px 0 0; }

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) td {
    background: var(--row-alt);
}

tbody tr:hover td {
    background: var(--row-hover) !important;
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.badge-complete   { background: #dff6dd; color: #107c10; border: 1px solid #a7d7a0; }
.badge-in_progress{ background: #dfe9ff; color: #2250bc; border: 1px solid #a0b8e8; }
.badge-planned    { background: #fff4ce; color: #8a6914; border: 1px solid #f0c040; }
.badge-cancelled  { background: #fde7e9; color: #c50f1f; border: 1px solid #f4aba7; }
.badge-on_hold    { background: #f3f3f3; color: #605e5c; border: 1px solid #c8c6c4; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-standard);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: #106ebe;
    border-color: #106ebe;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--input-border);
}

.btn-secondary:hover {
    background: #f3f3f3;
    border-color: #c8c6c4;
}

.btn-danger {
    background: #ffffff;
    color: #c50f1f;
    border-color: #c50f1f;
}

.btn-danger:hover {
    background: #fde7e9;
}

.btn-accent {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border-color: #b3d6f0;
}

.btn-accent:hover {
    background: #c7e0f4;
    border-color: var(--accent-blue);
}

/* ─── ID Links ────────────────────────────────────────────── */
.id-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
    border-bottom: 1px solid transparent;
}

.id-link:hover {
    color: #106ebe;
    border-bottom-color: #0078d4;
}

/* ─── Modal Styles ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    padding: 2rem;
    transform: translateY(16px);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-modal);
}

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: #c8c6c4; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-sidebar);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-standard);
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn-close:hover {
    background: #f3f3f3;
    color: var(--text-primary);
}

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

/* ─── Forms ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-sidebar);
    font-size: 0.8rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-standard);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ─── Detail Grid (Quick View) ────────────────────────────── */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    padding: 0.85rem 1rem;
    background: #f3f3f3;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.detail-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-sidebar);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.detail-item span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── Contact Buttons ─────────────────────────────────────── */
.contact-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.contact-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 4px;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition-standard);
    border: 1px solid #b3d6f0;
    line-height: 0;
}

.contact-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.contact-btn.call {
    background: #dff6dd;
    color: #107c10;
    border-color: #a7d7a0;
}

.contact-btn.call:hover {
    background: #107c10;
    color: #fff;
    border-color: #107c10;
}

.contact-btn svg {
    width: 14px;
    height: 14px;
}

.unread-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: #c50f1f;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: unreadPulse 2s infinite;
}

/* ─── Status Mail Wrapper ─────────────────────────────────── */
.status-mail-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    vertical-align: middle;
    margin-left: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: var(--transition-standard);
}

.status-mail-wrapper:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 4px var(--accent-blue));
}

.status-mail-icon {
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    opacity: 0.85;
}

.status-mail-icon svg {
    width: 16px;
    height: 16px;
}

.status-unread-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    background: #c50f1f;
    border-radius: 50%;
    border: 1px solid #fff;
}

/* ─── Email Split View ────────────────────────────────────── */
.email-split-view {
    display: flex;
    padding: 0 !important;
    overflow: hidden;
    height: 600px;
}

.modal-body-left {
    flex: 1.2;
    padding: 2rem;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.modal-body-right {
    flex: 1;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-sidebar);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.sync-status {
    font-size: 0.72rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.mail-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.history-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition-standard);
    cursor: pointer;
}

.history-item:hover {
    background: var(--row-hover);
    border-color: var(--accent-blue);
}

.history-item .item-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.history-item .direction {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
}

.direction.sent  { background: var(--accent-blue-light); color: var(--accent-blue); }
.direction.inbox { background: #dff6dd; color: #107c10; }

.history-item .date {
    font-size: 0.72rem;
    color: var(--text-sidebar);
}

.history-item h4 {
    margin: 0 0 0.3rem 0;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.history-item p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-sidebar);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modal-content.wide {
    max-width: 950px;
}

.btn-back-history {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-standard);
}

.btn-back-history:hover {
    color: #106ebe;
    transform: translateX(-2px);
}

.email-detail-view {
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}

.email-detail-view .detail-header {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.email-detail-view .detail-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.email-detail-view h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.email-detail-view .detail-body {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* ─── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes unreadPulse {
    0%   { box-shadow: 0 0 0 0 rgba(197, 15, 31, 0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(197, 15, 31, 0); }
    100% { box-shadow: 0 0 0 0 rgba(197, 15, 31, 0); }
}

.category-card {
    animation: fadeIn 0.4s ease forwards;
}

/* ─── Alert / Problem Badges ──────────────────────────────── */
.badge-problem {
    background: #fde7e9;
    color: #c50f1f;
    border: 1px solid #f4aba7;
    position: relative;
    overflow: hidden;
    animation: problemPulse 2s infinite;
    cursor: pointer;
    transition: var(--transition-standard);
}

.badge-problem:hover {
    background: #c50f1f;
    color: #fff;
    border-color: #c50f1f;
}

@keyframes problemPulse {
    0%   { box-shadow: 0 0 0 0 rgba(197, 15, 31, 0.35); }
    70%  { box-shadow: 0 0 0 8px rgba(197, 15, 31, 0); }
    100% { box-shadow: 0 0 0 0 rgba(197, 15, 31, 0); }
}

/* ─── Alert Cards ─────────────────────────────────────────── */
.alert-card {
    background: #fff8f8;
    border: 1px solid #f4aba7;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-standard);
}

.alert-card:hover {
    background: #fde7e9;
    border-color: #c50f1f;
}

.alert-info h4 {
    margin: 0 0 0.2rem 0;
    color: #c50f1f;
    font-size: 1rem;
}

.alert-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-sidebar);
}

.alert-meta {
    font-size: 0.75rem;
    color: var(--text-sidebar);
    margin-top: 0.4rem;
}

.category-card.alerts-card {
    border-color: #f4aba7;
}

.category-card.alerts-card .card-icon {
    background: #fde7e9;
    color: #c50f1f;
}

.alert-count-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #c50f1f;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    box-shadow: 0 0 8px rgba(197, 15, 31, 0.4);
}

/* ─── Quoting Modal & Dropzone ────────────────────────────── */
.modal-content.quoting-modal {
    max-width: 800px;
}

.dropzone {
    border: 2px dashed var(--input-border);
    border-radius: 6px;
    padding: 50px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9f9f9;
    margin: 16px 0;
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent-blue);
    background: var(--accent-blue-light);
}

.dropzone-content svg {
    margin-bottom: 12px;
    color: var(--accent-blue);
}

.dropzone-content p {
    font-size: 1rem;
    color: var(--text-sidebar);
}

.dropzone-content span {
    color: var(--accent-blue);
    font-weight: 600;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-sidebar);
}

.input-group input,
.input-group select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 0.55rem 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition-standard);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

/* ─── Stat Cards (Quoting) ────────────────────────────────── */
.stat-card {
    background: #f9f9f9;
    padding: 12px 14px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.stat-card .label {
    color: var(--text-sidebar);
    font-size: 0.8rem;
}

.stat-card .value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── Price Card ──────────────────────────────────────────── */
.price-card {
    background: linear-gradient(135deg, var(--accent-blue-light), #c7e0f4);
    border: 1px solid #b3d6f0;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    margin-top: 20px;
}

.price-card .label {
    display: block;
    color: var(--text-sidebar);
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.price-card .price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent-blue);
    display: block;
    letter-spacing: -0.02em;
}

.price-card .disclaimer {
    font-size: 0.72rem;
    color: var(--text-sidebar);
    margin-top: 8px;
}

/* ─── Items Table ─────────────────────────────────────────── */
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.items-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-sidebar);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    background: #f3f3f3;
}

.items-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.items-table tbody tr:hover {
    background: var(--row-hover);
}

.items-table tfoot td {
    padding-top: 1.25rem;
    font-weight: 600;
}

/* ─── Inline View Button ──────────────────────────────────── */
.btn-inline-view {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    border: 1px solid #b3d6f0;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 0.75rem;
    transition: var(--transition-standard);
}

.btn-inline-view:hover {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

/* ─── Stat Value Box ──────────────────────────────────────── */
.stat-value-box {
    width: 100%;
    background: #f9f9f9;
    border: 1px solid var(--input-border);
    padding: 0.55rem 0.75rem;
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    min-height: 38px;
    cursor: default;
}

/* ─── User Actions ────────────────────────────────────────── */
.user-actions {
    margin-right: 1rem;
    display: flex;
    align-items: center;
}

/* ─── Select Option Global Fix ────────────────────────────── */
select option {
    background-color: #ffffff;
    color: #1f1f1f;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 800px) {
    .sidebar {
        width: 60px;
        padding: 0;
    }
    .sidebar h2 span,
    .sidebar nav ul li a span {
        display: none;
    }
    .sidebar h2 {
        padding: 1.25rem 0;
        justify-content: center;
    }
    .sidebar nav ul li a {
        padding: 0.75rem;
        justify-content: center;
        border-left: none;
    }
    .main-content {
        margin-left: 60px;
    }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content {
        margin-left: 0;
    }
    header {
        padding: 0.75rem 1rem;
    }
    .category-grid,
    .data-table-container {
        margin: 1rem;
    }
}
