/* ============================================
   SURVOEIL PRO - DESIGN SYSTEM
   ============================================ */

:root {
    --primary: #EA580C;
    --primary-dark: #C2410C;
    --primary-light: #F97316;
    --primary-bg: #FFF7ED;
    --success: #16A34A;
    --success-light: #DCFCE7;
    --danger: #DC2626;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1F2937;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

.main-header {
    background: linear-gradient(135deg, #1F2937, #374151);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.logo-text {
    line-height: 1.2;
}

.logo-yamo {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
}

.logo-market {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-light);
}

.logo-text small {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    display: block;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.main-nav a {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    color: rgba(255,255,255,0.8);
}

.main-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.main-nav a.active {
    background: rgba(249,115,22,0.2);
    color: var(--primary-light);
    border: 1px solid rgba(249,115,22,0.3);
}

.btn-nav-vendor {
    background: rgba(249,115,22,0.15);
    border: 1px solid rgba(249,115,22,0.4);
}

.btn-nav-login {
    background: var(--primary);
    color: white !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    background: #1F2937;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav a {
    padding: 0.75rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--gray-200);
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar-title {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
    gap: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.sidebar-nav a i {
    width: 20px;
    font-size: 1rem;
}

.sidebar-nav a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header h1 i {
    color: var(--primary);
    font-size: 1.6rem;
}

.page-header p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

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

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon-orange { background: #FED7AA; color: var(--primary); }
.stat-icon-green { background: #DCFCE7; color: var(--success); }
.stat-icon-blue { background: #DBEAFE; color: var(--info); }
.stat-icon-red { background: #FEE2E2; color: var(--danger); }
.stat-icon-purple { background: #EDE9FE; color: #7C3AED; }

.stat-card-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-800);
}

.stat-card-info p {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Tables */
.data-table-wrapper {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.data-table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.data-table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
}

.data-table-header h3 i {
    color: var(--primary);
    margin-right: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.875rem 1rem;
    background: var(--gray-50);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

tr:hover td {
    background: var(--gray-50);
}

/* Forms */
.form-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.form-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-800);
}

.form-title i {
    color: var(--primary);
}

.form-subtitle {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--gray-700);
}

.required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-family: 'Poppins', sans-serif;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234,88,12,0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.form-hint {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.7rem;
    color: var(--danger);
    margin-top: 0.25rem;
    display: none;
}

.form-divider {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

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

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-active { background: #DCFCE7; color: #166534; }
.badge-pending { background: #FEF3C7; color: #92400E; }

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success { background: var(--success-light); color: #166534; border: 1px solid #BBF7D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.form-inline {
    display: none;
    background: var(--gray-50);
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: white;
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-400);
}

/* Maps */
#map, #heatmap {
    height: 500px;
    width: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 2px solid white;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* QR Codes */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.qr-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.qr-code-value {
    font-family: monospace;
    font-size: 0.7rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    word-break: break-all;
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .mobile-nav.open { display: flex; }
    .sidebar { width: 100%; position: static; height: auto; border-right: none; border-bottom: 1px solid var(--gray-200); }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .dashboard-layout { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .main-content { padding: 1rem; }
}