:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --warning: #f59e0b;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    gap: 0.75rem;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
}

.nav-link.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
    border-left: 4px solid var(--primary);
}

.nav-link.logout {
    color: #fca5a5;
    margin-top: 2rem;
}

.nav-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Header */
.top-header {
    margin-left: 260px;
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    transition: all 0.3s ease;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: calc(100vh - 64px);
    transition: all 0.3s ease;
}

/* Sidebar Collapsed State */
body.sidebar-collapsed .sidebar {
    width: 72px;
}

body.sidebar-collapsed .sidebar-header {
    padding: 1.5rem 0;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-header h2 {
    display: none;
}

body.sidebar-collapsed .sidebar-header::after {
    content: 'CV';
    font-weight: 700;
    color: white;
    font-size: 1.25rem;
}

body.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

body.sidebar-collapsed .nav-link i {
    margin: 0;
    font-size: 1.1rem;
}

body.sidebar-collapsed .nav-link span {
    display: none;
}

body.sidebar-collapsed .top-header,
body.sidebar-collapsed .main-content {
    margin-left: 72px;
}

/* Components */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.title-row h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: #cbd5e1;
}

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

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background: var(--bg-main);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.table tr:hover td {
    background: #fbfcfd;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #334155;
}

input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="number"], 
textarea, 
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Login Page */
.login-container {
    background: var(--sidebar-bg);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.login-box h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.login-box p {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* Timeline & Order Styles */
.vertical-timeline {
    border-left: 2px solid var(--border-color);
    margin-left: 8px;
    padding-left: 24px;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -7px;
    border: 2px solid white;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 1rem;
}

.bg-info { background-color: #0ea5e9 !important; color: white !important; }
.bg-primary { background-color: var(--primary) !important; color: white !important; }
.bg-success { background-color: var(--success) !important; color: white !important; }
.bg-warning { background-color: var(--warning) !important; color: white !important; }
.bg-danger { background-color: var(--danger) !important; color: white !important; }
.bg-dark { background-color: #1e293b !important; color: white !important; }
.bg-secondary { background-color: var(--secondary) !important; color: white !important; }

/* Dashboard Card Specifics */
.stat-card.oms-stat .stat-value {
    font-family: inherit;
    letter-spacing: -0.025em;
}

/* Utils */
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.ms-auto { margin-left: auto !important; }
.me-3 { margin-right: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.p-0 { padding: 0 !important; }
.p-4 { padding: 1.5rem !important; }
.w-100 { width: 100% !important; }
.text-center { text-align: center !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.pt-3 { padding-top: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
