@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0b132b;
    --bg-sidebar-hover: #1c2541;
    --bg-sidebar-active: #3a506b;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-light: #fef3c7;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    
    --border-color: #e2e8f0;
    --border-dark: #cbd5e1;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Layout Framework */
.app-container {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 270px;
    background: linear-gradient(180deg, #091124 0%, #0d1b38 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.25s ease;
}

.sidebar-header {
    padding: 24px 20px 20px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-badge {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.5);
}

.brand-info h2 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #ffffff;
    line-height: 1.2;
}

.brand-info span {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.app-sidebar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
    width: 0;
    height: 0;
}

.nav-section-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 12px 12px 6px 12px;
    margin-top: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(2, 132, 199, 0.25) 0%, rgba(2, 132, 199, 0.08) 100%);
    border-left: 3px solid #38bdf8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background-color: #334155;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.user-info span {
    font-size: 11px;
    color: #94a3b8;
    text-transform: capitalize;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: 270px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    height: 64px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.content-body {
    padding: 32px;
    flex: 1;
}

/* Luxury Grid & Cards */
.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
}

/* Stat Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.green { background-color: var(--success-light); color: var(--success); }
.stat-icon.amber { background-color: var(--accent-light); color: var(--accent); }
.stat-icon.purple { background-color: #f3e8ff; color: #9333ea; }
.stat-icon.red { background-color: var(--danger-light); color: var(--danger); }

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

.table th {
    background-color: #f8fafc;
    padding: 12px 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
}

.badge-success { background-color: var(--success-light); color: #065f46; }
.badge-warning { background-color: var(--warning-light); color: #92400e; }
.badge-danger { background-color: var(--danger-light); color: #991b1b; }
.badge-info { background-color: var(--primary-light); color: #075985; }
.badge-neutral { background-color: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.4);
}

.btn-dark {
    background-color: #0f172a;
    color: #ffffff !important;
}

.btn-dark:hover {
    background-color: #1e293b;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: #334155 !important;
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: var(--border-dark);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff !important;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff !important;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-main);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-col {
    flex: 1;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

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

.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
}

/* Multi-Step Wizard */
.wizard-steps {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: #ffffff;
    overflow-x: auto;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wizard-steps::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.wizard-step {
    padding: 14px 20px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.wizard-step.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background-color: #f8fafc;
}

.wizard-step.completed {
    color: var(--success);
}

.step-number {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background-color: #e2e8f0;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.wizard-step.active .step-number {
    background-color: var(--primary);
    color: #ffffff;
}

.wizard-step.completed .step-number {
    background-color: var(--success);
    color: #ffffff;
}

/* Signature Pad */
.signature-wrapper {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background-color: #ffffff;
    padding: 12px;
    text-align: center;
    position: relative;
}

.signature-canvas {
    width: 100%;
    height: 160px;
    touch-action: none;
    cursor: crosshair;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* Mobile responsive adjustments */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .grid-cols-4, .grid-cols-3, .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .content-body {
        padding: 16px;
    }
}
