body {
    font-family: 'Inter', sans-serif;
}

/* ── Sidebar links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: background-color 0.15s, color 0.15s;
    border-left: 2px solid transparent;
    color: #94a3b8; /* slate-400 */
}

.sidebar-link:hover {
    background-color: #1e293b; /* slate-800 */
    color: #fff;
}

.sidebar-link.active {
    background-color: rgba(51, 65, 85, 0.6); /* slate-700/60 */
    color: #fff;
    font-weight: 600;
    border-left-color: #60a5fa; /* blue-400 */
}

.sidebar-link svg {
    flex-shrink: 0;
    opacity: 0.75;
    width: 1rem;
    height: 1rem;
}

.sidebar-section {
    padding: 0.25rem 1rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b; /* slate-500 */
}

.sidebar-section:not(:first-child) {
    margin-top: 1.25rem;
}

/* ── Nav badge (notification count) ──────────────────────── */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background-color: #3b82f6; /* blue-500 */
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: auto;
}

/* ── Auth pages ───────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-blob-1 {
    position: absolute;
    top: -10rem;
    right: -10rem;
    width: 24rem;
    height: 24rem;
    background: #3b82f6;
    border-radius: 9999px;
    opacity: 0.05;
    filter: blur(3rem);
    pointer-events: none;
}

.auth-blob-2 {
    position: absolute;
    bottom: -10rem;
    left: -10rem;
    width: 24rem;
    height: 24rem;
    background: #6366f1;
    border-radius: 9999px;
    opacity: 0.05;
    filter: blur(3rem);
    pointer-events: none;
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
    overflow: hidden;
    width: 100%;
}

.auth-card-header {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    padding: 2rem;
    text-align: center;
}

.auth-card-header.amber {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.auth-card-header.red {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.auth-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: rgba(255,255,255,0.2);
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.auth-card-body {
    padding: 2rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 1.5rem;
}

/* ── Form fields ──────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155; /* slate-700 */
    margin-bottom: 0.25rem;
}

.form-label .required {
    color: #ef4444;
}

.form-input,
.form-select {
    width: 100%;
    border: 1px solid #cbd5e1; /* slate-300 */
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #1e293b;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-input[readonly] {
    background-color: #f8fafc;
    cursor: not-allowed;
    color: #64748b;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: background-color 0.15s, opacity 0.15s;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
}
.btn-primary:hover { background-color: #1d4ed8; }

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}
.btn-secondary:hover { background-color: #e2e8f0; }

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}
.btn-danger:hover { background-color: #dc2626; }

.btn-microsoft {
    background-color: #2f2f2f;
    color: #fff;
    width: 100%;
    justify-content: center;
}
.btn-microsoft:hover { background-color: #1a1a1a; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

/* ── Status badges ────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-1  { background:#f1f5f9; color:#475569; }
.status-2  { background:#eff6ff; color:#1d4ed8; }
.status-3  { background:#eef2ff; color:#4338ca; }
.status-4  { background:#fefce8; color:#a16207; }
.status-5  { background:#faf5ff; color:#7e22ce; }
.status-6  { background:#fff7ed; color:#c2410c; }
.status-7  { background:#fff7ed; color:#c2410c; }
.status-8  { background:#fff7ed; color:#c2410c; }
.status-9  { background:#f0fdf4; color:#15803d; }
.status-10 { background:#f0fdfa; color:#0f766e; }
.status-11 { background:#fef2f2; color:#b91c1c; }
.status-12 { background:#f8fafc; color:#94a3b8; }

/* ── Pipeline dots ────────────────────────────────────────── */
.pipeline-dots {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin-top: 0.375rem;
}

.pipeline-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background-color: #e2e8f0;
}

.pipeline-dot.done    { background-color: #3b82f6; }
.pipeline-dot.current { background-color: #2563eb; box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.125rem;
}

/* ── Stat cards ───────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: block;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 0.25rem;
}

/* ── Data table ───────────────────────────────────────────── */
.data-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}

.data-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.data-table thead tr {
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.data-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.1s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background-color: #f8fafc; }

.data-table td {
    padding: 0.75rem 1rem;
    color: #334155;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: background-color 0.1s;
}

.page-btn:hover { background-color: #f1f5f9; }
.page-btn.active { background-color: #2563eb; color: #fff; }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrap svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    text-align: center;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    background: #f1f5f9;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.25rem;
}

.empty-text {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

/* ── User dropdown ────────────────────────────────────────── */
.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 14rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    z-index: 50;
    overflow: hidden;
}

.user-dropdown.hidden { display: none; }

/* ── Role approval notice ─────────────────────────────────── */
.approval-notice {
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #b45309;
}

.approval-notice.visible { display: flex; }

/* ── MS verified banner ───────────────────────────────────── */
.ms-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.ms-verified-badge {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.7rem;
    background: #dcfce7;
    color: #16a34a;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* ── Signature guard modal animation ─────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1.25rem) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── RFQ create — field error state ──────────────────────── */
.form-input.input-error,
.form-select.input-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

/* ── Accounting title combobox ────────────────────────────── */
.acct-combo-wrap {
    position: relative;
}

.acct-combo-wrap::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

.acct-combo-wrap .acct-combo-input {
    padding-right: 2rem;
}

.acct-combo-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: -0.5rem;
    min-width: 22rem;
    z-index: 500;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.acct-combo-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 2rem;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 7px solid #fff;
    z-index: 1;
}

.acct-combo-dropdown::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 2rem;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 7px solid #e2e8f0;
    z-index: 0;
}

.acct-combo-dropdown.hidden {
    display: none;
}

.acct-combo-group {
    display: none;
}

.acct-combo-item {
    display: block;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background-color 0.12s ease;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #1e3a5f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f1f5f9;
}

.acct-combo-item:last-child {
    border-bottom: none;
}

.acct-combo-item:hover,
.acct-combo-item.highlighted {
    background-color: #f8fafc;
    color: #0f172a;
}

.acct-combo-item.selected {
    background-color: #eff6ff;
    color: #1e40af;
    font-weight: 500;
}

.acct-combo-code {
    display: inline;
    font-weight: 600;
    color: inherit;
    font-family: inherit;
}

.acct-combo-code::after {
    content: ' - ';
    color: #94a3b8;
    font-weight: 400;
}

.acct-combo-desc {
    display: inline;
    font-size: inherit;
    color: inherit;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.acct-combo-empty {
    padding: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}
