/* ============================================
   AFRI SOKO CONNECT - ENHANCED DESIGN SYSTEM
   Modern UI/UX • Native Mobile • Gradient Brand
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Open+Sans:wght@400;500;600&family=Lato:wght@400;700&display=swap');

/* ---------- ROOT VARIABLES ---------- */
:root {
    /* Brand Colors */
    --bg: #f8f6e9;
    --sidebar: #243b19;
    --sidebar-accent: #43621a;
    --primary: #caa033;
    --primary-dark: #986a1c;
    --accent: #fed923;
    --text: #1f2d12;
    --muted: #6f6a4a;
    --card: #ffffff;
    --success: #43621a;
    --warning: #fed923;
    --danger: #5f390a;
    
    /* Extended Brand */
    --caa033: #caa033;
    --ead56c: #ead56c;
    --color-243b19: #243b19;
    --fed923: #fed923;
    --color-986a1c: #986a1c;
    --color-43621a: #43621a;
    --a4a965: #a4a965;
    --ede32b: #ede32b;
    --color-5f390a: #5f390a;
    
    /* Design Tokens */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow: 0 18px 45px rgba(36, 59, 25, 0.12);
    --shadow-lg: 0 25px 60px rgba(36, 59, 25, 0.18);
    --shadow-gold: 0 12px 35px rgba(202, 160, 51, 0.3);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #243b19 0%, #43621a 50%, #5f390a 100%);
    --gradient-gold: linear-gradient(135deg, #caa033 0%, #fed923 50%, #ead56c 100%);
    --gradient-accent: linear-gradient(135deg, #986a1c 0%, #caa033 60%, #ede32b 100%);
    --gradient-sidebar: linear-gradient(180deg, #243b19 0%, #1a2a12 100%);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- GLOBAL RESET ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Open Sans', 'Lato', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: #243b19;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }

/* ---------- APP LAYOUT ---------- */
.app {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

/* ============================================
   HAMBURGER MENU TOGGLE
   ============================================ */
.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 101;
    background: var(--gradient-gold);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-gold);
    padding: 0;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-bounce);
}

.menu-toggle:hover {
    transform: scale(1.05);
}

.menu-toggle:active {
    transform: scale(0.95);
}

/* Hamburger Icon */
.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: #243b19;
    border-radius: 2px;
    transition: all var(--transition-smooth);
    transform-origin: center;
}

/* Sidebar Open - Animate Hamburger to X */
.sidebar.open ~ .menu-toggle .menu-icon span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.sidebar.open ~ .menu-toggle .menu-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.sidebar.open ~ .menu-toggle .menu-icon span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   SIDEBAR (Enhanced)
   ============================================ */
.sidebar {
    width: 280px;
    background: var(--gradient-sidebar);
    color: #fff;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: transform var(--transition-smooth);
    border-right: 1px solid rgba(234, 213, 108, 0.15);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(202, 160, 51, 0.4);
    border-radius: 10px;
}

/* Sidebar Header (with close button) */
.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-close {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-top: 4px;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Brand */
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    padding: 5px;
    object-fit: contain;
    transition: transform var(--transition-bounce);
    flex-shrink: 0;
}

.brand-logo:hover {
    transform: scale(1.08) rotate(-3deg);
}

.brand-logo--white {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(234, 213, 108, 0.6);
}

.brand div {
    min-width: 0;
}

.brand p {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.5px;
}

/* Navigation */
.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 14px;
    flex: 1;
}

.nav-section {
    margin-top: 16px;
    margin-bottom: 2px;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 6px 10px 4px;
    font-weight: 700;
}

.nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 12px;
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-gold);
    border-radius: 0 4px 4px 0;
    transition: height var(--transition-smooth);
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(135deg, rgba(202, 160, 51, 0.35), rgba(67, 98, 26, 0.6));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-item:hover i,
.nav-item.active i {
    opacity: 1;
    color: #fed923;
}

.nav-item:hover::before,
.nav-item.active::before {
    height: 60%;
}

.nav-item.active {
    font-weight: 600;
    border: 1px solid rgba(254, 217, 35, 0.25);
}

/* Sidebar Card */
.sidebar-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 14px;
}

.sidebar-card h4 {
    font-size: 14px;
    margin-bottom: 14px;
    color: #fed923;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card h4 i {
    font-size: 13px;
}

.insights-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.insights-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.insights-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    transition: all var(--transition-fast);
}

.insights-tab.active,
.insights-tab:hover {
    background: var(--gradient-gold);
    color: #243b19;
}

.sidebar-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
}

.sidebar-card li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: #fed923;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main {
    flex: 1;
    padding: 28px 36px;
    min-width: 0;
    background: radial-gradient(circle at 20% 0%, rgba(202,160,51,0.06) 0%, transparent 40%),
                radial-gradient(circle at 80% 100%, rgba(67,98,26,0.05) 0%, transparent 40%);
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 14px 20px;
    box-shadow: 0 12px 35px rgba(36, 59, 25, 0.08);
    border: 1px solid rgba(202, 160, 51, 0.15);
    flex-wrap: wrap;
    position: sticky;
    top: 16px;
    z-index: 50;
}

.search form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}

.search input {
    width: 340px;
    max-width: 100%;
    padding: 12px 18px 12px 42px;
    border-radius: 14px;
    border: 1.5px solid rgba(202, 160, 51, 0.3);
    background: #fff;
    font-size: 14px;
    transition: all var(--transition-smooth);
    outline: none;
    font-family: 'Open Sans', sans-serif;
}

.search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(202, 160, 51, 0.1);
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.user-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(202, 160, 51, 0.1);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-tag i {
    color: var(--primary);
    font-size: 18px;
}

.role-badge {
    background: var(--gradient-gold);
    color: #243b19;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn,
.btn-outline {
    padding: 11px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    white-space: nowrap;
    font-family: 'Open Sans', sans-serif;
    border: none;
}

.btn {
    background: var(--gradient-gold);
    color: #1f2d12;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(202, 160, 51, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(202, 160, 51, 0.4);
}

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

.btn-outline {
    color: var(--primary-dark);
    border: 1.5px solid rgba(202, 160, 51, 0.4);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(202, 160, 51, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.logout-btn {
    color: #5f390a;
    border-color: rgba(95, 57, 10, 0.3);
}

.logout-btn:hover {
    background: rgba(95, 57, 10, 0.05);
    border-color: #5f390a;
}

/* ============================================
   CONTENT & CARDS
   ============================================ */
.content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-title {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 700;
    margin-bottom: 14px;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-gold);
    border-radius: 4px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid rgba(202, 160, 51, 0.1);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeInUp 0.5s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: rgba(202, 160, 51, 0.25);
}

.card:hover::before {
    opacity: 1;
}

/* KPI */
.kpi,
.kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpi-card {
    justify-content: flex-start;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.kpi-icon.green { background: #1f8f4e; }
.kpi-icon.blue { background: #2d6ccf; }
.kpi-icon.orange { background: #f39c12; }
.kpi-icon.purple { background: #7d3cff; }
.kpi-icon.red { background: #e74c3c; }

.kpi-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kpi-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.kpi-value {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    color: #243b19;
}

.kpi-meta {
    font-size: 12px;
    color: #1f5e3b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.kpi-link {
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.kpi-link:hover {
    text-decoration: underline;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.badge.success {
    background: #e6f6ea;
    color: #1e7a3c;
    border: 1px solid #bfe8cc;
}

.badge.warning {
    background: #fff4cc;
    color: #a67000;
    border: 1px solid #f6d37a;
}

.badge.danger {
    background: #fde2e1;
    color: #b42318;
    border: 1px solid #f6b2ae;
}

.badge.info {
    background: #e6f0ff;
    color: #1f4dbb;
    border: 1px solid #c4d8ff;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
}

.table th,
.table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(202, 160, 51, 0.1);
}

.table th {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.08em;
    background: rgba(248, 246, 233, 0.5);
    position: sticky;
    top: 0;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(202,160,51,0.05), rgba(254,217,35,0.03));
}

.table a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.table a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   PANELS & TAGS
   ============================================ */
.panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel h4 {
    font-size: 16px;
    font-weight: 700;
}

.tag {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(202, 160, 51, 0.12);
    color: #5f390a;
    letter-spacing: 0.3px;
}

/* ============================================
   ANALYTICS
   ============================================ */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.summary-item {
    background: rgba(202, 160, 51, 0.08);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-item span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.summary-item strong {
    font-size: 18px;
    color: #243b19;
}

.summary-item small {
    font-size: 12px;
    color: #1f5e3b;
    font-weight: 600;
}

.summary-notes {
    font-size: 12px;
    color: var(--muted);
}

.chart-wrap {
    position: relative;
    min-height: 240px;
}

.predict-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.predict-item {
    background: rgba(31, 143, 78, 0.08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.predict-item span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.predict-item strong {
    font-size: 18px;
    color: #243b19;
}

.predict-item small {
    font-size: 12px;
    color: #1f5e3b;
    font-weight: 600;
}

.kpi-tag {
    align-items: center;
    gap: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(202, 160, 51, 0.18), rgba(254, 217, 35, 0.25));
    padding: 8px 14px;
    border-radius: 12px;
}

.kpi-tag img {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: #fff;
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   CHIPS
   ============================================ */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(67, 98, 26, 0.1);
    color: #243b19;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: rgba(67, 98, 26, 0.2);
    transform: translateY(-1px);
}

.chip-clear {
    background: rgba(95, 57, 10, 0.1);
    color: #5f390a;
}

.chip-owner {
    background: rgba(67, 98, 26, 0.08);
    color: #1f5e3b;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

/* ============================================
   FORMS
   ============================================ */
.form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(202, 160, 51, 0.25);
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    background: #fff;
    transition: all var(--transition-smooth);
    outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(202, 160, 51, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 24px;
    border-left: 2px solid rgba(202, 160, 51, 0.3);
}

.timeline-item {
    position: relative;
    padding-left: 16px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 12px;
    width: 12px;
    height: 12px;
    background: var(--gradient-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(202, 160, 51, 0.2);
}

.timeline-card {
    background: #fff;
    border: 1px solid rgba(202, 160, 51, 0.15);
    border-radius: 14px;
    padding: 16px 18px;
    transition: all var(--transition-fast);
}

.timeline-card:hover {
    box-shadow: var(--shadow);
    border-color: rgba(202, 160, 51, 0.3);
}

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

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-size: 12px;
    color: #4b5563;
}

.muted {
    color: #6b7280;
    font-size: 12px;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-body {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(202, 160, 51, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(36, 59, 25, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(254, 217, 35, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, #f8f6e9 0%, #f0ecd5 100%);
    font-family: 'Open Sans', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 28px;
    width: 100%;
    max-width: 1100px;
    align-items: center;
}

.auth-hero {
    background: var(--gradient-primary);
    color: #f8fafc;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 70px rgba(36, 59, 25, 0.3);
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(254,217,35,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(234,213,108,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.auth-brand div {
    min-width: 0;
}

.auth-brand p {
    margin: 0;
    font-weight: 700;
    font-size: 19px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand span {
    font-size: 12px;
    color: rgba(248, 250, 252, 0.75);
    letter-spacing: 0.3px;
}

.auth-logo {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    background: #fff;
    padding: 6px;
    object-fit: contain;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    flex-shrink: 0;
    border: 2px solid rgba(234,213,108,0.5);
}

.auth-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    background: linear-gradient(to right, #fff, #fed923);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hero > p {
    margin: 0;
    color: rgba(248, 250, 252, 0.78);
    font-size: 15px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

.auth-highlights {
    display: grid;
    gap: 18px;
    position: relative;
    z-index: 2;
}

.auth-highlights div {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(10px);
    border-left: 3px solid #fed923;
    padding: 14px 16px;
    border-radius: 12px;
    transition: all var(--transition-smooth);
}

.auth-highlights div:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(4px);
}

.auth-highlights h4 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #fed923;
}

.auth-highlights p {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: 0 25px 55px rgba(36, 59, 25, 0.15);
    border: 1px solid rgba(202, 160, 51, 0.2);
}

.auth-card h2 {
    margin-top: 0;
    font-size: 26px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
}

.auth-card .form-field {
    margin-bottom: 18px;
}

.auth-card .form-field input {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 15px;
    background: linear-gradient(105deg, #fff 0%, #fef9e7 100%);
}

.auth-card .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
    border-radius: 14px;
}

.auth-card .form-actions {
    flex-direction: column;
    gap: 12px;
}

.auth-card .btn-outline {
    text-align: center;
    justify-content: center;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (≤1100px) */
@media (max-width: 1100px) {
    .grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .search input {
        width: 240px;
    }
}

/* Small Tablet (≤900px) */
@media (max-width: 900px) {
    .grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .main {
        padding: 20px 18px;
    }
    
    .auth-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .auth-hero {
        padding: 36px 28px;
        border-radius: 24px;
    }
    
    .auth-hero h1 {
        font-size: 1.6rem;
    }
    
    .auth-card {
        padding: 32px 24px;
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    /* Show hamburger */
    .menu-toggle {
        display: flex;
    }
    
    /* Show close button in sidebar */
    .sidebar-close {
        display: flex;
    }
    
    /* Sidebar becomes off-canvas */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform var(--transition-smooth);
        z-index: 100;
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
        border-right: 1px solid rgba(234, 213, 108, 0.2);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3);
    }
    
    .main {
        padding: 20px 14px;
        padding-top: 76px;
    }
    
    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        position: relative;
        top: 0;
    }
    
    .search input {
        width: 100%;
    }
    
    .actions {
        justify-content: flex-start;
    }
    
    .grid-5 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        align-items: flex-start;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 18px;
    }
    
    .auth-body {
        padding: 16px 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .auth-hero {
        padding: 28px 20px;
    }
    
    .auth-hero h1 {
        font-size: 1.4rem;
    }
    
    .auth-card {
        padding: 24px 18px;
        border-radius: 22px;
    }
    
    .auth-card h2 {
        font-size: 22px;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .menu-toggle {
        top: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    
    .main {
        padding: 14px 10px;
        padding-top: 68px;
    }
    
    .topbar {
        padding: 10px 14px;
        border-radius: 16px;
    }
    
    .btn,
    .btn-outline {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    .actions {
        flex-direction: column;
        width: 100%;
    }
    
    .card {
        padding: 14px;
        border-radius: 18px;
    }
    
    h1 { font-size: 1.4rem; }
    h2 { font-size: 1.2rem; }
    
    .kpi {
        flex-direction: column;
        align-items: flex-start;
    }

    .kpi-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .auth-body {
        padding: 12px 8px;
        padding-top: 24px;
    }
    
    .auth-hero {
        padding: 20px 16px;
        border-radius: 20px;
        gap: 14px;
    }
    
    .auth-hero h1 {
        font-size: 1.2rem;
    }
    
    .auth-hero > p {
        font-size: 13px;
    }
    
    .auth-card {
        padding: 20px 14px;
        border-radius: 20px;
    }
    
    .auth-card h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .auth-highlights {
        gap: 10px;
    }
    
    .auth-highlights div {
        padding: 10px 12px;
    }
}

/* Large Desktop (≥1400px) */
@media (min-width: 1400px) {
    .main {
        padding: 36px 48px;
    }
    
    .auth-wrapper {
        max-width: 1200px;
    }
    
    .card {
        padding: 28px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(202, 160, 51, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(202, 160, 51, 0.5);
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .btn-outline:hover,
    .card:hover,
    .nav-item:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .topbar,
    .menu-toggle,
    .sidebar-overlay,
    .sidebar-close {
        display: none !important;
    }
    
    .main {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}