/* ============================================
   積算見積収集システム — Architectural Modern Theme
   Font: Zen Kaku Gothic New + DM Sans
   Palette: Warm slate + Teal accent
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

/* --- CSS Variables --- */
:root {
    /* Core palette */
    --c-slate-950: #0c1222;
    --c-slate-900: #131c2e;
    --c-slate-800: #1e293b;
    --c-slate-700: #334155;
    --c-slate-600: #475569;
    --c-slate-500: #64748b;
    --c-slate-400: #94a3b8;
    --c-slate-300: #cbd5e1;
    --c-slate-200: #e2e8f0;
    --c-slate-100: #f1f5f9;
    --c-slate-50: #f8fafc;

    /* Accent — Teal */
    --c-accent: #0d9488;
    --c-accent-light: #14b8a6;
    --c-accent-hover: #0f766e;
    --c-accent-50: #f0fdfa;
    --c-accent-100: #ccfbf1;
    --c-accent-200: #99f6e4;

    /* Semantic */
    --c-success: #16a34a;
    --c-success-bg: #f0fdf4;
    --c-warning: #d97706;
    --c-warning-bg: #fffbeb;
    --c-danger: #dc2626;
    --c-danger-bg: #fef2f2;
    --c-info: #0284c7;
    --c-info-bg: #f0f9ff;

    /* Surfaces */
    --c-bg: #f5f7fa;
    --c-surface: #ffffff;
    --c-border: #e5e7eb;
    --c-border-light: #f0f1f3;

    /* Text */
    --c-text: #1a1f2e;
    --c-text-secondary: #5a6378;
    --c-text-muted: #8b95a8;

    /* Typography */
    --font-sans: 'Zen Kaku Gothic New', 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'DM Sans', 'Zen Kaku Gothic New', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    /* Spacing & Shape */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows — layered for depth */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 48px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.05);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.2s;
    --duration-slow: 0.35s;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* --- Focus Visible --- */
:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.3);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-slate-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-slate-400); }

/* --- Selection --- */
::selection {
    background: var(--c-accent-200);
    color: var(--c-slate-900);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

small, .text-sm { font-size: 0.8125rem; }

a {
    color: var(--c-accent);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover {
    color: var(--c-accent-hover);
}

pre, code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

/* ============================================
   Login Page
   ============================================ */
body.login-page {
    background: var(--c-slate-950);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Architectural grid pattern background */
body.login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(13,148,136,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13,148,136,0.07) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 70%);
}

body.login-page::after {
    content: "";
    position: absolute;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(13,148,136,0.15), transparent 60%);
    pointer-events: none;
}

.login-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.05);
    max-width: 420px;
    width: 100%;
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 1;
    animation: loginAppear 0.5s var(--ease) both;
}

@keyframes loginAppear {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    color: var(--c-text);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.login-logo i {
    color: var(--c-accent);
}

.login-logo small {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--c-text-muted);
    margin-top: 0.5rem;
}

.btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--c-slate-900);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.875rem 1.5rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--duration) var(--ease);
    letter-spacing: 0.01em;
}

.btn-microsoft:hover {
    background: var(--c-slate-800);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-microsoft:active {
    transform: translateY(0);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: var(--c-slate-900) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1030;
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1rem;
    color: #fff !important;
    padding: 0.875rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: var(--c-accent-light);
    font-size: 1.1rem;
}

.nav-link {
    position: relative;
    color: var(--c-slate-400) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.875rem 1rem !important;
    transition: color var(--duration) var(--ease);
    letter-spacing: 0.01em;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--c-slate-200) !important;
}

.nav-link.active {
    color: #fff !important;
    font-weight: 600;
    border-bottom-color: var(--c-accent);
}

/* Remove the ::after pseudo underline since we use border-bottom now */
.nav-link.active::after {
    display: none;
}

.navbar-dark .nav-link.active::after,
.navbar .nav-link.active::after {
    display: none;
}

button.nav-link {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    outline: none;
}

button.nav-link:focus,
button.nav-link:focus-visible {
    outline: none;
    box-shadow: none;
}

button.nav-link.active {
    border-bottom-color: var(--c-accent);
}

.navbar .dropdown-menu {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    margin-top: 0.25rem;
}

.navbar .dropdown-item {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--c-text);
    transition: background-color var(--duration) var(--ease);
}

.navbar .dropdown-item:hover {
    background: var(--c-slate-100);
    color: var(--c-text);
}

.navbar .dropdown-item i {
    color: var(--c-text-muted);
}

.navbar .dropdown-divider {
    margin: 0.25rem 0;
    border-color: var(--c-border-light);
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-greeting {
    margin-bottom: 2rem;
    padding-top: 0.5rem;
}

.dashboard-greeting h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 0.125rem;
}

.dashboard-greeting p {
    font-size: 0.875rem;
    color: var(--c-text-muted);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--c-border);
    transition: all var(--duration-slow) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--c-slate-200);
}

.stat-card .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--c-text);
    letter-spacing: -0.03em;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-card .stat-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--c-accent);
    text-decoration: none;
    margin-top: 1rem;
    font-weight: 500;
    transition: gap var(--duration) var(--ease);
}

.stat-card .stat-link:hover {
    text-decoration: none;
    gap: 0.5rem;
}

/* Stat variations */
.stat-card.stat-primary::before { background: var(--c-accent); }
.stat-card.stat-primary .stat-icon { background: var(--c-accent-50); color: var(--c-accent); }

.stat-card.stat-success::before { background: var(--c-success); }
.stat-card.stat-success .stat-icon { background: var(--c-success-bg); color: var(--c-success); }

.stat-card.stat-warning::before { background: var(--c-warning); }
.stat-card.stat-warning .stat-icon { background: var(--c-warning-bg); color: var(--c-warning); }

.stat-card.stat-info::before { background: var(--c-info); }
.stat-card.stat-info .stat-icon { background: var(--c-info-bg); color: var(--c-info); }

/* Failed email alert */
.failed-email-alert {
    background: var(--c-surface);
    border: 1px solid #fca5a5;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--c-danger);
}

.failed-email-alert .alert-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.failed-email-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #fee2e2;
}

.failed-email-item:last-of-type {
    border-bottom: none;
}

.failed-email-details {
    margin-top: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--c-danger-bg);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.failed-detail-line {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    padding: 0.2rem 0;
    color: #7f1d1d;
}

.failed-detail-line i {
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 0.75rem;
}

/* Deadline alert */
.deadline-alert {
    background: var(--c-surface);
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--c-warning);
}

.deadline-alert .alert-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.deadline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #fef3c7;
}

.deadline-item:last-child {
    border-bottom: none;
}

.deadline-item a {
    color: var(--c-text);
    font-weight: 500;
    font-size: 0.875rem;
}

.deadline-item a:hover {
    color: var(--c-accent);
}

/* Dashboard sections */
.dashboard-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.dashboard-section-header h3 {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--c-text);
    margin: 0;
}

/* Dashboard table */
.dashboard-table {
    width: 100%;
    font-size: 0.875rem;
}

.dashboard-table thead th {
    background: var(--c-slate-50);
    color: var(--c-text-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.625rem 1.5rem;
    border: none;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.dashboard-table tbody tr {
    transition: background-color var(--duration) var(--ease);
}

.dashboard-table tbody td {
    padding: 0.75rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--c-border-light);
}

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

.dashboard-table tbody tr:hover {
    background-color: var(--c-slate-50);
}

.dashboard-table a {
    color: var(--c-accent);
    font-weight: 500;
}

.dashboard-table a:hover {
    color: var(--c-accent-hover);
}

.dashboard-table .empty-state {
    text-align: center;
    color: var(--c-text-muted);
    padding: 2.5rem 1rem;
    font-size: 0.875rem;
}

.dashboard-table .text-truncate-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Tables (shared)
   ============================================ */
.table {
    font-size: 0.875rem;
}

.table thead th {
    background: var(--c-slate-800);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    white-space: nowrap;
    padding: 0.75rem 1rem;
}

.table-light th {
    background: var(--c-slate-50) !important;
    color: var(--c-text-secondary) !important;
}

.table-hover tbody tr {
    transition: background-color var(--duration) var(--ease);
}

.table-hover tbody tr:hover {
    background-color: var(--c-accent-50) !important;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
    border-color: var(--c-border-light);
}

.table .btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--radius-xs);
    margin-right: 0.25rem;
}

/* ============================================
   Cards (shared)
   ============================================ */
.card {
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-xs);
    border-radius: var(--radius-lg);
    background: var(--c-surface);
}

.card-header {
    background-color: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    font-family: var(--font-display);
    font-weight: 600;
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
}

.card-body {
    padding: 1.25rem;
}

/* ============================================
   Buttons (overrides)
   ============================================ */
.btn {
    font-family: var(--font-display);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--c-accent);
    border-color: var(--c-accent);
}

.btn-primary:hover {
    background: var(--c-accent-hover);
    border-color: var(--c-accent-hover);
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
    color: var(--c-accent);
    border-color: var(--c-accent);
}

.btn-outline-primary:hover {
    background: var(--c-accent);
    border-color: var(--c-accent);
}

.btn-success {
    background: var(--c-success);
    border-color: var(--c-success);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.625rem;
    border-radius: var(--radius-xs);
}

/* ============================================
   Badges / Status
   ============================================ */
.badge {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-xs);
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-xl);
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-active { background: var(--c-success-bg); color: #15803d; }
.badge-closed { background: var(--c-slate-100); color: var(--c-slate-600); }
.badge-downloaded { background: #dbeafe; color: #1e40af; }
.badge-uploaded { background: var(--c-success-bg); color: #15803d; }
.badge-pending { background: var(--c-warning-bg); color: #b45309; }
.badge-expired { background: var(--c-danger-bg); color: #b91c1c; }

/* ============================================
   Vendor Select Area
   ============================================ */
.vendor-select-area {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    max-height: 500px;
    overflow-y: auto;
    background: var(--c-surface);
}

.vendor-filter-bar {
    position: sticky;
    top: 0;
    background: var(--c-surface);
    z-index: 10;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--c-border);
    backdrop-filter: blur(8px);
}

.vendor-checkbox-item {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--c-border-light);
    transition: background-color var(--duration) var(--ease);
    cursor: pointer;
}

.vendor-checkbox-item:hover {
    background-color: var(--c-accent-50);
}

.vendor-checkbox-item:last-child {
    border-bottom: none;
}

.vendor-checkbox-item .form-check-label {
    cursor: pointer;
    width: 100%;
}

.vendor-checkbox-item .vendor-trade {
    font-size: 0.8rem;
    color: var(--c-text-muted);
}

.vendor-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--c-accent);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-xl);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   File Upload
   ============================================ */
.file-drop-zone {
    border: 2px dashed var(--c-slate-300);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--c-text-muted);
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    background: var(--c-slate-50);
}

.file-drop-zone:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-50);
    color: var(--c-accent);
}

.file-drop-zone.dragover {
    border-style: solid;
    border-color: var(--c-accent);
    background: var(--c-accent-50);
    color: var(--c-accent);
    transform: scale(1.01);
}

.file-drop-zone .drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    background: var(--c-slate-50);
    border: 1px solid var(--c-border-light);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    font-size: 0.875rem;
    transition: background-color var(--duration) var(--ease);
}

.file-list-item:hover {
    background: var(--c-slate-100);
}

.file-list-item .file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.file-list-item .file-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-item .file-size {
    color: var(--c-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.file-list-item .btn-remove-file {
    border: none;
    background: none;
    color: var(--c-danger);
    padding: 0.15rem 0.4rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: background-color var(--duration) var(--ease);
    flex-shrink: 0;
}

.file-list-item .btn-remove-file:hover {
    background-color: var(--c-danger-bg);
}

/* ============================================
   Tabs
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid var(--c-border);
}

.nav-tabs .nav-link {
    color: var(--c-text-muted) !important;
    border: none;
    padding: 0.75rem 1.25rem !important;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--duration) var(--ease);
}

.nav-tabs .nav-link:hover {
    color: var(--c-text) !important;
    border-bottom-color: var(--c-slate-300);
}

.nav-tabs .nav-link.active {
    color: var(--c-accent) !important;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--c-accent);
    background: transparent;
}

.nav-tabs .nav-link.active::after {
    display: none;
}

.tab-content {
    padding: 1.5rem 0;
}

/* ============================================
   Vendor Portal
   ============================================ */
.portal-header {
    background: linear-gradient(135deg, var(--c-accent-50) 0%, #ecfdf5 50%, #f0fdfa 100%);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--c-accent-100);
    position: relative;
    overflow: hidden;
}

.portal-header::before {
    content: "";
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: rgba(13,148,136,0.06);
    border-radius: 50%;
}

.portal-header h2,
.portal-header h3,
.portal-header h4 {
    color: var(--c-slate-800);
    font-family: var(--font-display);
}

.portal-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--c-border);
}

.download-btn {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius);
    font-family: var(--font-display);
}

.download-btn i {
    margin-right: 0.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-control, .form-select {
    border-color: var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.form-control:focus, .form-select:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-label {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--c-text-secondary);
    margin-bottom: 0.375rem;
}

.form-check-input:checked {
    background-color: var(--c-accent);
    border-color: var(--c-accent);
}

.form-text, .form-control::placeholder {
    color: var(--c-text-muted);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border-radius: var(--radius);
    font-size: 0.875rem;
    border-left-width: 4px;
}

/* ============================================
   Pagination
   ============================================ */
.pagination .page-link {
    color: var(--c-text-secondary);
    border-color: var(--c-border);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    transition: all var(--duration) var(--ease);
}

.pagination .page-link:hover {
    color: var(--c-accent);
    background: var(--c-accent-50);
    border-color: var(--c-accent);
}

.pagination .page-item.active .page-link {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}

/* ============================================
   Utilities
   ============================================ */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1,
.page-header h2 {
    font-weight: 700;
    color: var(--c-text);
}

.content-wrapper {
    padding: 1.5rem 0;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Container override */
.container-fluid {
    max-width: 1400px;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ============================================
   Vendor Card: overdue
   ============================================ */
.vendor-card.border-danger {
    border-width: 2px !important;
    border-color: var(--c-danger) !important;
    background-color: var(--c-danger-bg);
}

/* ============================================
   Modal
   ============================================ */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--c-border);
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-family: var(--font-display);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--c-border);
    padding: 1rem 1.5rem;
}

/* ============================================
   TinyMCE override
   ============================================ */
.tox.tox-tinymce {
    border-radius: var(--radius) !important;
    border-color: var(--c-border) !important;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .vendor-select-area {
        max-height: 350px;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .portal-header {
        padding: 1.25rem 1rem;
    }

    .download-btn {
        width: 100%;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 1.3rem;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8125rem;
    }

    .file-drop-zone {
        padding: 1.5rem 1rem;
    }

    .dashboard-greeting h2 {
        font-size: 1.25rem;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    body {
        background: #fff;
        font-size: 12pt;
    }

    .navbar, .btn, .file-drop-zone,
    .vendor-filter-bar, .no-print {
        display: none !important;
    }

    .card, .dashboard-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .stat-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table thead th, .dashboard-table thead th {
        background-color: #eee !important;
        color: #333 !important;
    }

    a[href]::after { content: none; }
}

/* ============================================
   Page transition animation
   ============================================ */
.container-fluid {
    animation: pageIn 0.3s var(--ease) both;
}

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

/* ============================================
   Footer
   ============================================ */
.site-footer {
    color: var(--c-text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.site-footer a {
    color: var(--c-text-muted);
}

.site-footer a:hover {
    color: var(--c-accent);
}
