/* Kia Customer Module — Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #F4F7F6;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F9FAFB;
  --accent: #000000;
  --accent-hover: #333333;
  --accent-glow: rgba(0,0,0,0.15);
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --border-focus: #000000;
  --success: #059669;
  --success-bg: #D1FAE5;
  --error: #DC2626;
  --error-bg: #FEE2E2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* --- Layout --- */
.page-wrapper { max-width:1400px; margin:0 auto; padding:1rem; }

/* --- Top Navbar --- */
.top-navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container { width:100%; max-width:1400px; margin:0 auto; padding:0 1rem; display:flex; justify-content:space-between; align-items:center; }
.nav-left { display:flex; align-items:center; gap:1rem; }
.nav-logo { height:28px; object-fit:contain; }
.nav-title { font-weight:700; font-size:1rem; letter-spacing:-0.01em; color:var(--text-primary); border-left:1px solid var(--border); padding-left:1rem; }
.nav-right { display:flex; align-items:center; gap:1rem; }
.user-profile { display:flex; align-items:center; gap:0.75rem; margin-left:0.5rem; padding-left:1rem; border-left:1px solid var(--border); }
.user-name { font-size:0.8rem; font-weight:600; color:var(--text-secondary); }
.logout-link { color:var(--text-muted); font-size:1.1rem; transition:color var(--transition); }
.logout-link:hover { color:var(--error); }

.mini-stat { display:flex; align-items:center; gap:0.4rem; background:#F9FAFB; padding:0.35rem 0.75rem; border-radius:var(--radius-sm); border:1px solid var(--border); font-size:0.8rem; }
.mini-stat .label { color:var(--text-muted); font-weight:500; }
.mini-stat .value { font-weight:700; color:var(--accent); }

/* --- Buttons --- */
.btn { display:inline-flex; align-items:center; gap:0.45rem; padding:0.65rem 1.4rem; border:none; border-radius:var(--radius-sm); font-family:inherit; font-size:0.875rem; font-weight:600; cursor:pointer; transition:all var(--transition); text-decoration:none; white-space:nowrap; }
.btn-primary { background:var(--accent); color:#fff; box-shadow:0 2px 12px var(--accent-glow); }
.btn-primary:hover { background:var(--accent-hover); box-shadow:0 4px 20px var(--accent-glow); transform:translateY(-1px); color:#fff; }
.btn-secondary { background:var(--bg-surface); color:var(--text-primary); border:1px solid var(--border); }
.btn-secondary:hover { background:var(--bg-surface-hover); border-color:rgba(0,0,0,0.2); }
.btn-sm { padding:0.4rem 0.8rem; font-size:0.8rem; }
.btn-icon { padding:0.55rem 0.75rem; border-radius:var(--radius-sm); background:var(--bg-surface); border:1px solid var(--border); color:var(--text-secondary); cursor:pointer; transition:all var(--transition); font-size:0.85rem; }
.btn-icon:hover { background:var(--accent); color:#fff; border-color:var(--accent); }

/* --- Filters Bar --- */
.filters-bar { background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); padding:0.5rem 0.75rem; margin-bottom:0.75rem; }
.filters-form { display:flex; align-items:flex-end; gap:0.75rem; flex-wrap:wrap; }
.filter-group { display:flex; flex-direction:column; gap:0.3rem; }
.filter-group label { font-size:0.7rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; }
.filter-group.search { flex:3; min-width:280px; position:relative; }
.filter-group.search .search-icon { position:absolute; left:10px; bottom:8px; color:#000; display:flex; align-items:center; pointer-events:none; }
.filter-group.search input { padding-left:2.2rem; padding-right:2.2rem; }
.filter-group input, .filter-group select { padding:0.3rem 0.6rem; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:0.85rem; background:var(--bg-primary); width:100%; color:var(--text-primary); font-family:inherit; cursor:pointer; height:32px; }
.filter-group select:focus { outline:none; border-color:var(--border-focus); box-shadow:0 0 0 3px var(--accent-glow); }

.clear-btn { position:absolute; right:10px; bottom:8px; background:none; border:none; color:var(--text-muted); font-size:1.2rem; cursor:pointer; padding:0 5px; line-height:1; transition:color var(--transition); }
.clear-btn:hover { color:var(--accent); }

.highlight { background:#FEF3C7; color:#92400E; padding:0 2px; border-radius:2px; }

/* --- Table --- */
.table-container { background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.table-scroll { overflow-x:auto; }

.data-table { width:100%; border-collapse:collapse; font-size:0.875rem; }
.data-table thead { background:#F9FAFB; }
.data-table thead th { padding:0.75rem 1rem; text-align:left; font-weight:600; font-size:0.7rem; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); border-bottom:1px solid var(--border); white-space:normal; cursor:pointer; user-select:none; transition:color var(--transition); }
.data-table thead th:hover { color:var(--text-primary); }
.data-table tbody tr { border-bottom:1px solid var(--border); transition:background var(--transition); animation:fadeInRow 0.4s ease both; }
.data-table tbody tr:last-child { border-bottom:none; }
.data-table tbody tr:hover { background:var(--bg-surface-hover); }
.data-table tbody td { padding:0.6rem 1rem; color:var(--text-secondary); white-space:normal; }
.data-table tbody td:first-child { color:var(--text-primary); font-weight:500; }
.data-table .cell-email { color:var(--accent); }
.data-table .cell-car { display:inline-flex; align-items:center; gap:0.4rem; padding:0.25rem 0.7rem; background:#F3F4F6; border:1px solid #E5E7EB; border-radius:20px; color:#374151; font-size:0.8rem; font-weight:500; }

/* Row stagger animation */
.data-table tbody tr:nth-child(1)  { animation-delay:0.03s; }
.data-table tbody tr:nth-child(2)  { animation-delay:0.06s; }
.data-table tbody tr:nth-child(3)  { animation-delay:0.09s; }
.data-table tbody tr:nth-child(4)  { animation-delay:0.12s; }
.data-table tbody tr:nth-child(5)  { animation-delay:0.15s; }
.data-table tbody tr:nth-child(6)  { animation-delay:0.18s; }
.data-table tbody tr:nth-child(7)  { animation-delay:0.21s; }
.data-table tbody tr:nth-child(8)  { animation-delay:0.24s; }
.data-table tbody tr:nth-child(9)  { animation-delay:0.27s; }
.data-table tbody tr:nth-child(10) { animation-delay:0.30s; }

@keyframes fadeInRow { from { opacity:0; transform:translateX(-8px); } to { opacity:1; transform:translateX(0); } }

/* --- Card View (Mobile) --- */
.cards-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:1rem; }
.customer-card { background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); padding:1rem; box-shadow:var(--shadow); transition:transform var(--transition); }
.customer-card:hover { transform:translateY(-2px); border-color:var(--accent); }
.card-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:0.75rem; padding-bottom:0.5rem; border-bottom:1px solid var(--border); }
.card-title h3 { font-size:1rem; font-weight:700; color:var(--text-primary); }
.card-index { font-size:0.7rem; color:var(--text-muted); font-weight:600; }
.card-body { display:flex; flex-direction:column; gap:0.4rem; }
.card-info { font-size:0.85rem; display:flex; justify-content:space-between; align-items:center; }
.info-label { color:var(--text-muted); font-weight:500; }

/* --- Forms --- */
.form-card { background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); padding:2rem; max-width:720px; margin:0 auto; box-shadow:var(--shadow-lg); }
.form-card h2 { font-size:1.35rem; font-weight:700; margin-bottom:0.3rem; }
.form-card .form-subtitle { color:var(--text-muted); font-size:0.875rem; margin-bottom:2rem; padding-bottom:1.5rem; border-bottom:1px solid var(--border); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; }
.form-group { display:flex; flex-direction:column; gap:0.4rem; }
.form-group.full-width { grid-column:1 / -1; }
.form-group label { font-size:0.8rem; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.04em; }
.form-group label .required { color:var(--accent); margin-left:2px; }
.form-group input, .form-group select, .form-group textarea { padding:0.7rem 1rem; background:var(--bg-primary); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text-primary); font-family:inherit; font-size:0.9rem; transition:all var(--transition); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color:var(--border-focus); box-shadow:0 0 0 3px var(--accent-glow); }
.form-group input::placeholder, .form-group textarea::placeholder { color:var(--text-muted); }
.form-group input.input-error, .form-group select.input-error { border-color:var(--error); box-shadow:0 0 0 3px var(--error-bg); }
.form-group .error-text { font-size:0.75rem; color:var(--error); display:none; }
.form-group .error-text.visible { display:block; }
.form-actions { display:flex; align-items:center; justify-content:flex-end; gap:0.75rem; margin-top:2rem; padding-top:1.5rem; border-top:1px solid var(--border); }

/* --- Alerts --- */
.alert { padding:1rem 1.25rem; border-radius:var(--radius-sm); font-size:0.875rem; font-weight:500; margin-bottom:1.5rem; display:flex; align-items:center; gap:0.5rem; animation:slideDown 0.35s ease; }
.alert-success { background:var(--success-bg); border:1px solid rgba(16,185,129,0.3); color:var(--success); }
.alert-error { background:var(--error-bg); border:1px solid rgba(239,68,68,0.3); color:var(--error); }
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* --- Empty State --- */
.empty-state { text-align:center; padding:4rem 2rem; }
.empty-state h3 { font-size:1.1rem; color:var(--text-secondary); margin-bottom:0.4rem; }
.empty-state p { color:var(--text-muted); font-size:0.875rem; margin-bottom:1.5rem; }

/* --- Back Link --- */
.back-link { display:inline-flex; align-items:center; gap:0.4rem; color:var(--text-muted); font-size:0.875rem; font-weight:500; margin-bottom:1.5rem; transition:color var(--transition); }
.back-link:hover { color:var(--text-primary); }

/* --- Pagination --- */
.pagination { display:flex; justify-content:center; align-items:center; gap:0.5rem; margin-top:1rem; padding:0.5rem 0; }
.page-btn { padding:0.4rem 0.8rem; border-radius:var(--radius-sm); background:var(--bg-surface); border:1px solid var(--border); color:var(--text-secondary); text-decoration:none; font-size:0.85rem; transition:all var(--transition); }
.page-btn:hover { background:var(--bg-surface-hover); color:var(--text-primary); border-color:var(--border-focus); }
.page-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.page-btn.disabled { opacity:0.5; pointer-events:none; }

/* --- Responsive --- */
.desktop-view { display:block; }
.mobile-view { display:none; }

@media (max-width: 992px) {
  .desktop-view { display:none; }
  .mobile-view { display:block; }
}

@media (max-width: 768px) {
  .page-header { flex-direction:row; justify-content:space-between; align-items:center; }
  .header-main h1 { font-size:1.2rem; }
  .filters-bar { padding:0.75rem; }
  .filter-group.search { min-width:100%; }
  .filter-group.date { flex:1; }
  .filter-actions { width:100%; margin-top:0.5rem; }
  .filter-actions .btn { flex:1; justify-content:center; }
  .cards-grid { grid-template-columns:1fr; }
}
