:root {
  --bg-main: #0a0d14;
  --bg-surface: #111622;
  --bg-card: rgba(20, 27, 42, 0.75);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.35);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --warning: #f59e0b;
  --danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ========================================= */
/* HEADER & NAVIGATION */
/* ========================================= */
.app-header {
  height: 72px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top-bar {
  display: contents;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  order: 1;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 26px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.server-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
}

.nav-tabs {
  order: 2;
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #fff;
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

.header-right {
  order: 3;
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--success));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-dept {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-logout:hover {
  background: #ef4444;
  color: #fff;
}

.btn-primary-sm {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-primary-sm:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 16px var(--primary-glow);
}

/* ========================================= */
/* MAIN CONTENT LAYOUT */
/* ========================================= */
.main-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile Profile Card - Hidden on Desktop */
.mobile-user-card {
  display: none;
}

/* ========================================= */
/* TAB 1: DASHBOARD */
/* ========================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
}

/* Clock Card */
.clock-card {
  text-align: center;
  padding: 28px 24px;
  margin-bottom: 24px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.clock-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.clock-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 8px;
}

.digital-time {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  margin-bottom: 6px;
}

.digital-date {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
}

.device-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.device-tag code {
  font-family: var(--font-mono);
  color: #38bdf8;
}

/* Action Card */
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title h3 {
  font-size: 18px;
  font-weight: 700;
}

.badge-status {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.select-wrapper {
  display: flex;
  gap: 8px;
}

select, input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

select:focus, input:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-refresh-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s;
}

.btn-refresh-select:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.work-code-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-code-hint strong {
  color: #fff;
}

/* Switch Toggle Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
}

.toggle-info strong {
  font-size: 14px;
  display: block;
}

.toggle-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Action Attendance Buttons */
.attendance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.btn-action {
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-action:hover {
  transform: translateY(-2px);
}

.btn-action:active {
  transform: translateY(1px);
}

.btn-datang {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.btn-datang:hover {
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.5);
}

.btn-pulang {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

.btn-pulang:hover {
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.5);
}

.action-icon {
  font-size: 32px;
}

.action-text .primary-label {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.action-text .sub-label {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  margin-top: 4px;
}

.action-footer {
  margin-top: 18px;
  text-align: center;
}

.btn-outline-sm {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-family: var(--font-sans);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-outline-sm:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Map Card */
.map-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.card-header-flex h3 {
  font-size: 18px;
  font-weight: 700;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-gps-refresh {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.btn-gps-refresh:hover {
  background: var(--primary);
  color: #fff;
}

.coords-display {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.coord-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.coord-box .label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}

.coord-box .value {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #38bdf8;
  margin-top: 4px;
}

.map-view {
  flex: 1;
  min-height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  z-index: 10;
}

.mock-warning-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
}

/* ========================================= */
/* TAB 2: POSTMAN CONSOLE */
/* ========================================= */
.postman-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.tag-jsonrpc {
  background: rgba(147, 51, 234, 0.2);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.4);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.url-input-group {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(10, 15, 25, 0.8);
}

.http-badge {
  background: #3b82f6;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  letter-spacing: 0.5px;
}

.url-input-group input {
  border: none;
  background: transparent;
  padding: 10px 12px;
}

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

.editor-actions {
  display: flex;
  gap: 10px;
}

.btn-link {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

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

.code-editor {
  height: 290px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  background: #080c14;
  color: #a5f3fc;
  resize: vertical;
}

.btn-send-request {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: 0.2s;
  margin-top: 10px;
}

.btn-send-request:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 22px var(--primary-glow);
}

.response-panel {
  display: flex;
  flex-direction: column;
}

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

.response-metrics {
  display: flex;
  gap: 10px;
}

.metric-status {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
}

.metric-status.status-200 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.metric-status.status-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.metric-time {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.response-body-wrapper {
  flex: 1;
  background: #080c14;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px;
  min-height: 420px;
  max-height: 520px;
  overflow: auto;
}

.response-json {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.response-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ========================================= */
/* TAB 3: TABLE RIWAYAT */
/* ========================================= */
.table-responsive {
  overflow-x: auto;
  margin-top: 18px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.date-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 15, 25, 0.7);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.date-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.date-separator {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.input-date-filter {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12.5px;
  width: auto !important;
  color-scheme: dark;
}

.input-date-filter:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.preset-buttons-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-preset-date {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}

.btn-preset-date:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.4);
}

.btn-preset-date.active {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.btn-load-history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
}

.btn-load-history .load-icon {
  font-size: 13px;
  display: inline-block;
}

.load-icon.spinning {
  animation: spinHistory 0.9s linear infinite;
}

@keyframes spinHistory {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.history-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  white-space: nowrap;
}

.history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  vertical-align: middle;
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.time-highlight {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #f1f5f9;
}

.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-type.badge-masuk {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-type.badge-pulang {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-mode.badge-mode-kehadiran {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-mode.badge-mode-wfh {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-mode.badge-mode-wfo {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-mode.badge-mode-apel {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-mode.badge-mode-izin,
.badge-mode.badge-mode-cuti,
.badge-mode.badge-mode-sakit {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-mode.badge-mode-dinas {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.35);
}

.badge-status.badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.link-photo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: 0.2s;
}

.link-photo:hover {
  background: var(--primary);
  color: #fff;
}

/* ========================================= */
/* MODAL & TOASTS */
/* ========================================= */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-attendance {
  max-width: 480px !important;
}

.attend-result-card {
  text-align: center;
  padding: 6px 0;
}

.attend-result-icon {
  font-size: 50px;
  margin-bottom: 12px;
}

.attend-result-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}

.attend-result-title.success {
  color: #34d399;
}

.attend-result-title.error {
  color: #f87171;
}

.attend-result-msg {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.attend-detail-list {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
  text-align: left;
}

.attend-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.attend-detail-item:last-child {
  border-bottom: none;
}

.attend-detail-label {
  color: var(--text-muted);
}

.attend-detail-val {
  font-weight: 600;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
}

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

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  padding-bottom: 10px;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal-tab-btn.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.login-subtab {
  display: none;
}

.login-subtab.active {
  display: block;
}

.btn-primary-block {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 10px;
}

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.hidden {
  display: none !important;
}

/* Office Geofence & Auto-Randomizer Banner */
.office-geofence-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 78, 59, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.office-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.office-icon {
  font-size: 24px;
}

.office-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #34d399;
}

.office-meta {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.btn-random-office {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-md) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 12.5px !important;
}

.btn-random-office:hover {
  background: rgba(16, 185, 129, 0.35) !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-preset-office-zone {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

.btn-preset-office-zone:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #fff !important;
}

/* Location Toolbar & Presets */
.location-toolbar {
  margin-bottom: 14px;
}

.search-input-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.search-input-wrapper input {
  font-size: 13px;
  padding: 8px 12px;
}

.btn-search-loc {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
}

.btn-search-loc:hover {
  background: var(--primary);
  color: #fff;
}

.quick-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}

.preset-buttons-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-preset:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: rgba(59, 130, 246, 0.4);
}

.custom-preset-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  padding: 0 4px 0 10px;
  transition: 0.2s;
}

.custom-preset-chip:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
}

.custom-preset-chip .btn-preset-name {
  background: transparent;
  border: none;
  color: #93c5fd;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 2px;
}

.custom-preset-chip .btn-preset-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
  border-radius: 50%;
  transition: 0.2s;
}

.custom-preset-chip .btn-preset-del:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

.btn-add-preset {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  border: 1px dashed rgba(16, 185, 129, 0.45) !important;
  font-weight: 600 !important;
}

.btn-add-preset:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #34d399 !important;
  color: #fff !important;
}

.empty-preset-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  padding: 4px 6px;
}

.emoji-picker-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-emoji-opt {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
}

.btn-emoji-opt.selected, .btn-emoji-opt:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
  transform: scale(1.1);
}

.coord-input {
  background: transparent !important;
  border: none !important;
  padding: 4px 0 !important;
  font-family: var(--font-mono) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #38bdf8 !important;
  box-shadow: none !important;
}

.coord-input:focus {
  outline: none;
  border-bottom: 1px solid #38bdf8 !important;
}

.map-instruction-banner {
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.35);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* ========================================= */
/* DESKTOP NAV & TABLE HINTS DEFAULT */
/* ========================================= */
.nav-text-mobile {
  display: none;
}
.nav-text-desktop {
  display: inline;
}
.table-scroll-hint {
  display: none;
}

/* ========================================= */
/* RESPONSIVE DESIGN & MOBILE UX */
/* ========================================= */

/* Tablet & Intermediate Screens */
@media (max-width: 1024px) {
  .dashboard-grid, .postman-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .main-content {
    padding: 20px;
  }
}

/* Mobile Devices (Phones & Small Tablets) */
@media (max-width: 768px) {
  /* Prevent tap zoom delay and set mobile font sizing on inputs to prevent iOS auto-zoom */
  button, select, input, a {
    touch-action: manipulation;
  }

  select, input[type="text"], input[type="password"], input[type="date"], input[type="number"], textarea {
    font-size: 15px !important;
  }

  /* Sticky Top App Bar: Multi-row Container (Header + Profile + Nav) */
  .app-header {
    height: auto !important;
    min-height: auto !important;
    padding: 10px 12px 10px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(10, 13, 20, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  }

  .header-top-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 0 0 auto !important;
  }

  .brand-logo {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .logo-icon {
    font-size: 16px !important;
    padding: 4px !important;
    border-radius: 6px !important;
  }

  .brand-text h1 {
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  .brand-subtitle {
    display: none !important;
  }

  /* Server Badge in Top-Right on Mobile */
  .server-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    border-radius: 999px !important;
    color: #34d399 !important;
  }

  .server-name {
    display: none !important;
  }

  .server-badge::after {
    content: 'Online' !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #34d399 !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
  }

  /* Hide desktop user chip on mobile top bar as mobileUserCard is directly below */
  .header-top-bar .header-right .user-chip {
    display: none !important;
  }

  .user-avatar {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary), var(--success)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    flex-shrink: 0 !important;
  }

  .user-details {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    overflow: hidden !important;
    max-width: 120px !important;
    text-align: left !important;
  }

  .user-name {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    display: block !important;
  }

  .user-dept {
    font-size: 9.5px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    display: block !important;
  }

  .btn-logout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    border-radius: 6px !important;
    background: rgba(239, 68, 68, 0.25) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
  }

  .btn-logout .logout-icon {
    font-size: 12px !important;
    display: inline !important;
  }

  .btn-logout .logout-text {
    display: none !important;
  }

  .btn-logout:hover,
  .btn-logout:active {
    background: #ef4444 !important;
    color: #ffffff !important;
  }

  .btn-primary-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }

  /* ========================================= */
  /* 1. Mobile Profile Card */
  /* ========================================= */
  .mobile-user-card {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    border-radius: var(--radius-lg) !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  }

  .mobile-user-card.hidden {
    display: none !important;
  }

  .user-avatar-lg {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #3b82f6, #10b981) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5) !important;
    flex-shrink: 0 !important;
  }

  .user-meta {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .user-greeting {
    font-size: 9.5px !important;
    color: #38bdf8 !important;
    font-weight: 700 !important;
    display: block !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  .user-fullname {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 2px 0 1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.25 !important;
  }

  .user-department {
    font-size: 10.5px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
  }

  .btn-logout-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
    padding: 6px 10px !important;
    border-radius: var(--radius-md) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: 0.2s !important;
  }

  .btn-logout-badge:hover,
  .btn-logout-badge:active {
    background: #ef4444 !important;
    color: #ffffff !important;
  }

  /* ========================================= */
  /* 2. Navigation Tabs (Directly Below mobileUserCard) */
  /* ========================================= */
  .nav-tabs {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    gap: 6px !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    margin: 0 !important;
  }

  .nav-btn {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    white-space: nowrap !important;
    transition: 0.2s !important;
  }

  .nav-btn .icon {
    font-size: 14px !important;
    line-height: 1 !important;
  }

  .nav-btn.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4) !important;
    border: none !important;
    font-weight: 700 !important;
  }

  .nav-text-desktop {
    display: none !important;
  }

  .nav-text-mobile {
    display: inline !important;
    font-weight: 600 !important;
  }

  /* Main Container Sizing - Normal Flow */
  .main-content {
    padding: 14px 12px 30px !important;
  }

  .glass-card {
    padding: 16px 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
  }

  /* Clock Card on Mobile */
  .clock-card {
    padding: 18px 12px;
    margin-bottom: 12px;
  }

  .digital-time {
    font-size: clamp(34px, 10vw, 44px);
    letter-spacing: 1px;
    margin-bottom: 4px;
  }

  .digital-date {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .device-tag {
    font-size: 11px;
    padding: 4px 10px;
    max-width: 100%;
    word-break: break-all;
  }

  /* Attendance Action Buttons on Mobile */
  .attendance-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .btn-action {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: 14px 16px;
    gap: 14px;
    border-radius: 14px;
  }

  .btn-action .action-icon {
    font-size: 28px;
    flex-shrink: 0;
  }

  .action-text .primary-label {
    font-size: 15px;
    font-weight: 800;
  }

  .action-text .sub-label {
    font-size: 11px;
    margin-top: 2px;
  }

  .action-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
  }

  .btn-outline-sm {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    text-align: center;
  }

  /* Map and Geolocation Section on Mobile */
  .map-card {
    height: auto;
  }

  .map-view {
    height: 270px;
    min-height: 250px;
    border-radius: 12px;
  }

  .card-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn-gps-refresh {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  .search-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .btn-search-loc {
    width: 100%;
    padding: 10px;
    justify-content: center;
  }

  .coords-display {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .coords-display .coord-box:last-child {
    grid-column: 1 / -1;
  }

  .coord-box {
    padding: 8px 10px;
  }

  .coord-box .value {
    font-size: 13px;
  }

  .quick-presets {
    gap: 6px;
  }

  .custom-preset-chip .btn-preset-name {
    font-size: 11px;
    padding: 4px 2px;
  }

  .btn-add-preset {
    font-size: 11px;
    padding: 4px 8px;
  }

  .map-instruction-banner {
    padding: 8px 12px;
    font-size: 11.5px;
    margin-bottom: 10px;
  }

  /* Tab 2: Postman / API Console on Mobile */
  .editor-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .editor-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .editor-actions .btn-link {
    font-size: 11.5px;
  }

  .code-editor {
    height: 190px;
    font-size: 12px;
    padding: 10px;
  }

  .response-body-wrapper {
    min-height: 200px;
    max-height: 320px;
    padding: 12px;
  }

  .response-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .response-metrics {
    flex-wrap: wrap;
  }

  /* Tab 3: Riwayat Absen on Mobile */
  .table-scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    margin-bottom: 12px;
  }

  .history-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
  }

  .date-range-group {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    box-sizing: border-box;
  }

  .date-input-wrap {
    flex: 1;
    min-width: 0;
    gap: 4px;
  }

  .date-label {
    font-size: 10.5px;
  }

  .date-input-wrap .input-date-filter {
    width: 100% !important;
    font-size: 11.5px !important;
    padding: 5px 6px !important;
  }

  .preset-buttons-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
    gap: 5px;
  }

  .preset-buttons-group .btn-preset-date {
    padding: 6px 2px !important;
    font-size: 11px !important;
    text-align: center;
  }

  .btn-load-history {
    width: 100% !important;
    padding: 10px !important;
    font-size: 13px !important;
    justify-content: center !important;
  }

  .history-table th,
  .history-table td {
    padding: 10px 10px;
    font-size: 12px;
  }

  /* Bottom-Sheet Style Modals on Mobile */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px 16px;
    margin: 0;
    animation: modalSheetUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes modalSheetUp {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Floating Toast positioning on Mobile */
  .toast-container {
    bottom: calc(70px + env(safe-area-inset-bottom, 12px));
    right: 12px;
    left: 12px;
  }

  .toast {
    width: 100%;
    font-size: 12.5px;
    padding: 10px 14px;
  }
}

/* ========================================================================== */
/* Samsung Galaxy Z Fold Cover Screen & Ultra-Narrow Devices (<= 400px & <= 360px) */
/* ========================================================================== */
@media (max-width: 400px) {
  /* Prevent horizontal scrolling & ensure compact container spacing */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  /* Compact Sticky Header */
  .app-header {
    padding: 8px 10px 8px !important;
    gap: 6px !important;
  }

  .header-left {
    gap: 5px !important;
  }

  .logo-icon {
    font-size: 14px !important;
    padding: 3px !important;
  }

  .brand-text h1 {
    font-size: 13px !important;
  }

  .server-badge {
    padding: 2px 7px !important;
    font-size: 10px !important;
  }

  .server-badge::after {
    font-size: 10px !important;
  }

  .btn-primary-sm {
    padding: 5px 9px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  /* Compact Mobile Profile Card */
  .mobile-user-card {
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  .user-avatar-lg {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 13px !important;
  }

  .user-greeting {
    font-size: 8.5px !important;
    letter-spacing: 0.3px !important;
  }

  .user-fullname {
    font-size: 12px !important;
    max-width: 140px !important;
  }

  .user-department {
    font-size: 10px !important;
    max-width: 140px !important;
  }

  .btn-logout-badge {
    padding: 5px 8px !important;
    font-size: 10.5px !important;
    gap: 3px !important;
  }

  /* Ultra-Fit Navigation Tabs (Guaranteed no overflow / multi-line wrap on 344px) */
  .nav-tabs {
    padding: 3px !important;
    gap: 4px !important;
    border-radius: 10px !important;
  }

  .nav-btn {
    padding: 6px 3px !important;
    gap: 3px !important;
    font-size: 10.5px !important;
    min-width: 0 !important;
  }

  .nav-btn .icon {
    font-size: 13px !important;
  }

  .nav-text-mobile {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
  }

  /* Main Viewport & Card Spacing */
  .main-content {
    padding: 10px 8px 24px !important;
  }

  .glass-card {
    padding: 12px 10px !important;
    border-radius: 14px !important;
    margin-bottom: 10px !important;
  }

  /* Clock Card */
  .clock-card {
    padding: 14px 10px !important;
    margin-bottom: 10px !important;
  }

  .digital-time {
    font-size: 30px !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
  }

  .digital-date {
    font-size: 11.5px !important;
    margin-bottom: 8px !important;
  }

  .device-tag {
    font-size: 9.5px !important;
    padding: 3px 8px !important;
    max-width: 100% !important;
    line-height: 1.3 !important;
  }

  /* Attendance Buttons */
  .attendance-actions {
    gap: 8px !important;
  }

  .btn-action {
    padding: 11px 12px !important;
    gap: 10px !important;
    border-radius: 12px !important;
  }

  .btn-action .action-icon {
    font-size: 24px !important;
  }

  .action-text .primary-label {
    font-size: 13.5px !important;
  }

  .action-text .sub-label {
    font-size: 10.5px !important;
  }

  .action-footer {
    gap: 6px !important;
    margin-top: 10px !important;
  }

  .btn-outline-sm {
    padding: 8px !important;
    font-size: 12px !important;
  }

  /* Map View & Controls */
  .map-view {
    height: 230px !important;
    min-height: 210px !important;
    border-radius: 10px !important;
  }

  .card-header-flex h3 {
    font-size: 13.5px !important;
  }

  .btn-gps-refresh {
    padding: 8px !important;
    font-size: 12px !important;
  }

  /* Office Geofence Banner */
  .office-geofence-banner {
    padding: 8px 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
  }

  .office-icon {
    font-size: 20px !important;
  }

  .office-name {
    font-size: 12.5px !important;
  }

  .office-meta {
    font-size: 10px !important;
  }

  .office-banner-actions {
    width: 100% !important;
  }

  .btn-random-office {
    width: 100% !important;
    justify-content: center !important;
    padding: 7px 10px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
  }

  /* Search & Presets Toolbar */
  .location-toolbar {
    margin-bottom: 10px !important;
  }

  .search-input-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .search-input-wrapper input {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 7px 10px !important;
    font-size: 12px !important;
  }

  .btn-search-loc {
    width: auto !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
  }

  .quick-presets {
    gap: 4px !important;
  }

  .presets-label {
    font-size: 9.5px !important;
  }

  .preset-buttons-list {
    gap: 4px !important;
  }

  .btn-preset {
    padding: 3px 7px !important;
    font-size: 10.5px !important;
  }

  .custom-preset-chip {
    padding: 0 3px 0 7px !important;
  }

  .custom-preset-chip .btn-preset-name {
    font-size: 10.5px !important;
    padding: 3px 2px !important;
  }

  .custom-preset-chip .btn-preset-del {
    font-size: 12px !important;
    padding: 0 3px !important;
  }

  .btn-add-preset {
    padding: 3px 7px !important;
    font-size: 10.5px !important;
  }

  /* Coordinates Display Grid */
  .coords-display {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  .coord-box {
    padding: 6px 8px !important;
    border-radius: 8px !important;
  }

  .coord-box .label {
    font-size: 9.5px !important;
  }

  .coord-box .value {
    font-size: 11.5px !important;
  }

  /* Riwayat Filter Controls - Fold Optimized */
  .history-controls {
    gap: 6px !important;
    margin-top: 8px !important;
  }

  .date-range-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 8px !important;
    border-radius: 10px !important;
  }

  .date-range-separator {
    display: none !important;
  }

  .date-input-wrap {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }

  .date-input-wrap .date-label {
    font-size: 10px !important;
    width: 48px !important;
    flex-shrink: 0 !important;
  }

  .date-input-wrap .input-date-filter {
    flex: 1 !important;
    min-width: 0 !important;
    font-size: 12px !important;
    padding: 5px 8px !important;
    border-radius: 6px !important;
  }

  /* 2x2 Grid for Preset Dates on Narrow Screens */
  .preset-buttons-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px !important;
  }

  .preset-buttons-group .btn-preset-date {
    padding: 7px 4px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
  }

  .btn-load-history {
    padding: 9px !important;
    font-size: 12.5px !important;
  }

  .history-table th,
  .history-table td {
    padding: 8px 6px !important;
    font-size: 11px !important;
  }

  .badge-type,
  .badge-mode {
    font-size: 9.5px !important;
    padding: 2px 5px !important;
  }

  /* Modals on Fold Screens */
  .modal-card {
    padding: 16px 12px 24px !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .modal-header h3 {
    font-size: 14px !important;
  }

  .modal-tabs {
    gap: 6px !important;
    margin-bottom: 12px !important;
  }

  .modal-tab-btn {
    padding: 7px 6px !important;
    font-size: 11px !important;
  }

  .form-group label {
    font-size: 11.5px !important;
  }

  .btn-primary-block {
    padding: 10px !important;
    font-size: 13px !important;
  }

  /* Toast notification */
  .toast {
    font-size: 11.5px !important;
    padding: 8px 12px !important;
  }
}

/* Extra Tight Fold Viewport (<= 340px) */
@media (max-width: 340px) {
  .brand-text h1 {
    font-size: 12px !important;
  }

  .nav-btn {
    padding: 5px 2px !important;
  }

  .nav-text-mobile {
    font-size: 9.5px !important;
  }

  .user-fullname {
    max-width: 110px !important;
    font-size: 11px !important;
  }

  .user-department {
    max-width: 110px !important;
    font-size: 9.5px !important;
  }

  .btn-logout-badge {
    padding: 4px 6px !important;
    font-size: 9.5px !important;
  }
}


