@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* ==========================================================================
   OPTICAL ERP - HIGH DENSITY GLOBAL DESIGN SYSTEM (80% SCALE LOOK)
   ========================================================================== */

:root {
    --crm-font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --crm-bg: #f8fafc;
    --crm-card-bg: #ffffff;
    --crm-card-border: #e2e8f0;
    --crm-text-primary: #0f172a;
    --crm-text-secondary: #475569;
    --crm-text-muted: #64748b;
    --crm-primary: #2563eb;
    --crm-primary-hover: #1d4ed8;
    --crm-success: #10b981;
    --crm-info: #0284c7;
    --crm-warning: #f59e0b;
    --crm-danger: #ef4444;
    --crm-purple: #6f42c1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px; /* Compact base scale */
}

body {
    font-family: var(--crm-font-family);
    background-color: var(--crm-bg);
    color: var(--crm-text-primary);
    font-size: 0.85rem;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.main {
    margin-left: 0;
    width: 100%;
}

.content {
    padding: 1rem 1.25rem;
    min-height: calc(100vh - 120px);
}

footer {
    background: #ffffff;
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    color: var(--crm-text-muted);
    font-size: 0.8rem;
}

/* ==========================================================================
   CARD & CONTAINER SYSTEM
   ========================================================================== */

.card {
    border-radius: 12px;
    border: 1px solid var(--crm-card-border);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: var(--crm-card-bg);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: #ffffff !important;
}

.card-body {
    padding: 1.1rem;
}

/* ==========================================================================
   COMPACT HIGH-CONTRAST TABLES
   ========================================================================== */

.table {
    font-size: 0.8125rem;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.65rem;
    background-color: #0f172a;
    color: #f8fafc;
    border-bottom: none;
    white-space: nowrap;
    vertical-align: middle;
}

.table th {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
    color: #1e293b;
}

.table th.bg-light,
.table th.table-light,
.table-light th,
.table td.bg-light,
.table .bg-light {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

.table td {
    padding: 0.5rem 0.65rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f8fafc;
}

.table-hover > tbody > tr:hover > * {
    background-color: #eef2ff !important;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-track {
    background-color: #f1f5f9;
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */

.form-label {
    font-size: 0.775rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--crm-text-secondary);
    margin-bottom: 0.25rem;
}

.form-control, .form-select {
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    color: var(--crm-text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control-sm, .form-select-sm {
    font-size: 0.775rem;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.form-control-lg, .form-select-lg {
    font-size: 0.875rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */

.btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: 5px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.badge {
    font-weight: 600;
    font-size: 0.725rem;
    padding: 0.35em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.bg-purple {
    background-color: var(--crm-purple) !important;
    color: #ffffff !important;
}

.bg-purple-subtle {
    background-color: #f3ebf9 !important;
}

.text-purple {
    color: var(--crm-purple) !important;
}

.border-purple {
    border-color: var(--crm-purple) !important;
}

.border-purple-subtle {
    border-color: #e2d5f3 !important;
}

/* ==========================================================================
   ALERTS & MODALS
   ========================================================================== */

.alert {
    border-radius: 8px;
    font-size: 0.825rem;
    padding: 0.65rem 1rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.modal-header {
    padding: 0.75rem 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 0.65rem 1.25rem;
    background-color: #f8fafc;
    border-top: 1px solid #f1f5f9;
}