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

:root {
    --stripe-bg: #f6f9fc;
    --stripe-white: #ffffff;
    --stripe-text: #1a1f36;
    --stripe-text-secondary: #697386;
    --stripe-text-muted: #8792a2;
    --stripe-border: #e3e8ee;
    --stripe-border-light: #f0f2f5;
    --stripe-accent: #635bff;
    --stripe-accent-hover: #5145e5;
    --stripe-accent-light: #f0efff;
    --stripe-success: #0d9488;
    --stripe-success-bg: #ecfdf5;
    --stripe-danger: #ef4444;
    --stripe-danger-bg: #fef2f2;
    --stripe-warning: #f59e0b;
    --stripe-warning-bg: #fffbeb;
    --stripe-info: #3b82f6;
    --stripe-info-bg: #eff6ff;
    --stripe-shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --stripe-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --stripe-shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --stripe-radius: 8px;
    --stripe-radius-lg: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--stripe-bg);
    color: var(--stripe-text);
    font-size: 0.9375rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--stripe-text);
    letter-spacing: -0.01em;
}

.navbar {
    border-bottom: 1px solid var(--stripe-border);
    padding: 0.5rem 0;
    box-shadow: none;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem !important;
    border-radius: 6px;
    transition: background-color 0.15s, color 0.15s;
    margin: 0 2px;
}

.navbar .nav-link:hover {
    background-color: rgba(255,255,255,0.12);
}

.navbar .nav-link.active {
    background-color: rgba(255,255,255,0.18);
}

.card {
    border: 1px solid var(--stripe-border);
    border-radius: var(--stripe-radius);
    box-shadow: var(--stripe-shadow-sm);
    background: var(--stripe-white);
}

.card-header {
    background: var(--stripe-white);
    border-bottom: 1px solid var(--stripe-border);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--stripe-white);
    border-top: 1px solid var(--stripe-border);
}

.table {
    font-size: 0.875rem;
}

.table th {
    white-space: nowrap;
    font-weight: 600;
    color: var(--stripe-text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
    background: var(--stripe-bg);
}

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

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: transparent;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #fafbfc;
}

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
    border-radius: 20px;
    letter-spacing: 0.01em;
}

.badge.bg-success { background-color: var(--stripe-success) !important; }
.badge.bg-danger { background-color: var(--stripe-danger) !important; }
.badge.bg-warning { background-color: var(--stripe-warning) !important; color: #fff !important; }
.badge.bg-primary { background-color: var(--stripe-accent) !important; }
.badge.bg-info { background-color: var(--stripe-info) !important; }
.badge.bg-secondary { background-color: var(--stripe-text-muted) !important; }

.btn {
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--stripe-accent-hover);
    border-color: var(--stripe-accent-hover);
    box-shadow: 0 2px 8px rgba(99,91,255,0.25);
}

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

.btn-success:hover {
    background-color: #0b8578;
    border-color: #0b8578;
}

.btn-danger {
    background-color: var(--stripe-danger);
    border-color: var(--stripe-danger);
}

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

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

.btn-outline-secondary {
    color: var(--stripe-text-secondary);
    border-color: var(--stripe-border);
}

.btn-outline-secondary:hover {
    background-color: var(--stripe-bg);
    border-color: var(--stripe-border);
    color: var(--stripe-text);
}

.btn-outline-success {
    color: var(--stripe-success);
    border-color: var(--stripe-success);
}

.btn-outline-success:hover {
    background-color: var(--stripe-success);
    border-color: var(--stripe-success);
}

.btn-outline-danger {
    color: var(--stripe-danger);
    border-color: var(--stripe-danger);
}

.btn-outline-danger:hover {
    background-color: var(--stripe-danger);
    border-color: var(--stripe-danger);
}

.form-control, .form-select {
    border: 1px solid var(--stripe-border);
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: var(--stripe-text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--stripe-accent);
    box-shadow: 0 0 0 3px rgba(99,91,255,0.12);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--stripe-text-secondary);
    margin-bottom: 0.35rem;
}

.form-text {
    font-size: 0.8rem;
    color: var(--stripe-text-muted);
}

.input-group-text {
    border: 1px solid var(--stripe-border);
    background: var(--stripe-bg);
    font-size: 0.875rem;
    color: var(--stripe-text-secondary);
}

.breadcrumb {
    font-size: 0.8125rem;
    background: none;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--stripe-accent);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--stripe-accent-hover);
}

.breadcrumb-item.active {
    color: var(--stripe-text-muted);
}

.alert {
    border-radius: var(--stripe-radius);
    font-size: 0.875rem;
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: var(--stripe-success-bg);
    color: #065f46;
}

.alert-danger {
    background-color: var(--stripe-danger-bg);
    color: #991b1b;
}

.alert-warning {
    background-color: var(--stripe-warning-bg);
    color: #92400e;
}

.alert-info {
    background-color: var(--stripe-info-bg);
    color: #1e40af;
}

.dropdown-menu {
    border: 1px solid var(--stripe-border);
    border-radius: var(--stripe-radius);
    box-shadow: var(--stripe-shadow-lg);
    font-size: 0.875rem;
    padding: 0.375rem;
}

.dropdown-item {
    border-radius: 5px;
    padding: 0.45rem 0.75rem;
    font-weight: 500;
    color: var(--stripe-text);
}

.dropdown-item:hover {
    background-color: var(--stripe-bg);
}

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

.modal-content {
    border: 1px solid var(--stripe-border);
    border-radius: var(--stripe-radius-lg);
    box-shadow: var(--stripe-shadow-lg);
}

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

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

.progress {
    border-radius: 20px;
    background-color: var(--stripe-border-light);
    overflow: hidden;
}

.progress-bar {
    border-radius: 20px;
}

.nav-tabs {
    border-bottom: 1px solid var(--stripe-border);
}

.nav-tabs .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stripe-text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.625rem 1rem;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
    color: var(--stripe-text);
    border-bottom-color: var(--stripe-border);
}

.nav-tabs .nav-link.active {
    color: var(--stripe-accent);
    border-bottom-color: var(--stripe-accent);
    background: none;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0;
}

.page-header .page-description {
    color: var(--stripe-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.stat-card {
    border: 1px solid var(--stripe-border);
    border-radius: var(--stripe-radius);
    background: var(--stripe-white);
    padding: 1.25rem;
    box-shadow: var(--stripe-shadow-sm);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--stripe-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--stripe-text);
    letter-spacing: -0.02em;
}

.stat-card .stat-accent {
    color: var(--stripe-accent);
}

.stat-card .stat-success {
    color: var(--stripe-success);
}

.stat-card .stat-warning {
    color: var(--stripe-warning);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--stripe-border);
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--stripe-text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--stripe-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.section-heading {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--stripe-text-muted);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--stripe-border);
}

.list-group-item {
    border-color: var(--stripe-border-light);
    font-size: 0.875rem;
    padding: 0.65rem 1rem;
}

.list-group-item.active {
    background-color: var(--stripe-accent-light);
    border-color: var(--stripe-accent-light);
    color: var(--stripe-accent);
}

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

.text-accent { color: var(--stripe-accent); }
.bg-accent-light { background-color: var(--stripe-accent-light); }

.table-dark th {
    background: var(--stripe-text) !important;
    color: #fff;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

hr {
    border-color: var(--stripe-border);
    opacity: 1;
}

a {
    color: var(--stripe-accent);
}

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

.btn-close {
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

.avails-wrapper {
    overflow-x: auto;
    overflow-y: visible;
}

.avails-grid {
    min-width: 900px;
    font-size: 0.82rem;
}

.avails-territory-col {
    min-width: 170px;
    max-width: 200px;
    font-weight: 500;
    background: var(--stripe-white);
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid var(--stripe-border) !important;
}

.avails-right-col {
    min-width: 72px;
}

.avails-notes-col {
    min-width: 160px;
}

.avails-region-row td {
    background: var(--stripe-text);
    color: #fff;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 8px;
    font-weight: 600;
}

.avail-cell {
    text-align: center;
    cursor: pointer;
    user-select: none;
    padding: 3px 2px !important;
    transition: opacity 0.15s;
    vertical-align: middle;
    line-height: 1.2;
}

.avail-cell:hover { opacity: 0.8; }
.avail-none      { background: var(--stripe-bg); color: var(--stripe-text-muted); }
.avail-available { background: var(--stripe-success); color: #fff; }
.avail-sold      { background: var(--stripe-danger); color: #fff; }
.avail-hold      { background: var(--stripe-warning); color: #fff; }

.avail-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
}

.excl-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0px 4px;
    border-radius: 3px;
    margin-top: 1px;
    cursor: pointer;
    line-height: 1.4;
}

.excl-e  { background: rgba(255,255,255,0.35); }
.excl-ne { background: rgba(0,0,0,0.15); }

.excl-badge-demo {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    cursor: default;
}

.excl-badge-demo.excl-e  { background: var(--stripe-success); color: #fff; }
.excl-badge-demo.excl-ne { background: var(--stripe-text-muted); color: #fff; }

.avail-legend { font-size: 0.78rem; cursor: default; }
.avail-legend.avail-none      { background: var(--stripe-bg); color: var(--stripe-text-muted); border-color: var(--stripe-border) !important; }
.avail-legend.avail-available { background: var(--stripe-success); color: #fff; border: none; }
.avail-legend.avail-sold      { background: var(--stripe-danger); color: #fff; border: none; }
.avail-legend.avail-hold      { background: var(--stripe-warning); color: #fff; border: none; }

.signature-pad-wrapper {
    border: 1px solid var(--stripe-border) !important;
    border-radius: var(--stripe-radius);
}

.card.bg-light, .card.bg-light .card-body {
    background-color: var(--stripe-bg) !important;
    border-color: var(--stripe-border);
}

.text-dark-50 {
    color: var(--stripe-text-secondary) !important;
}
