/* ==========================================================================
   Dwisma Timemark - Bright Light-Glass Premium SaaS Design System
   ========================================================================== */

/* Variables & Curated Bright Color Tokens */
:root {
  --bg-primary: #f8fafc; /* Clean Slate White */
  --bg-secondary: #f1f5f9; /* Light Slate Gray */
  --bg-glass: rgba(255, 255, 255, 0.72); /* Frosted Glass */
  --bg-glass-heavy: rgba(255, 255, 255, 0.95);
  --bg-glass-dark: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(255, 255, 255, 0.7);
  --border-glass-glow: rgba(99, 102, 241, 0.25);
  
  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #475569; /* Slate 600 */
  --text-muted: #94a3b8; /* Slate 400 */
  
  /* Bright High-Contrast SaaS Gradients */
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%); /* Royal Indigo */
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%); /* Emerald */
  --danger-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); /* Rose */
  --glow-gradient: linear-gradient(90deg, #4f46e5 0%, #10b981 100%);
  
  --primary: #4f46e5; /* Royal Indigo */
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.15);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.15);

  --danger: #f43f5e;
  --danger-hover: #e11d48;
  
  --warning: #f59e0b;
  --info: #0ea5e9;

  --admin-badge: #b45309;
  --user-badge: #0369a1;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;
  
  /* Soft Shadow Aesthetics */
  --shadow-glow: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(255, 255, 255, 0.6);
  --shadow-neon: 0 15px 35px -10px rgba(79, 70, 229, 0.12);
  --shadow-input: inset 0 2px 4px 0 rgba(15, 23, 42, 0.02);
}

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

/* Elegant Slate Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body {
  background-color: var(--bg-primary);
  /* Buttery Smooth Static Mesh Gradients - 100% Lag Free & Hardware Accelerated */
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(244, 63, 94, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Typography styling */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

/* Glassmorphism Containers (Light SaaS Style - Optimized for Performance) */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06), 0 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: var(--transition-smooth);
  /* Triggers GPU layer promotion for smooth animations */
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.1), 0 0 1px 1px rgba(255, 255, 255, 0.5);
  transform: translate3d(0, -2px, 0);
}

.glass-dark {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
  transform: translate3d(0, 0, 0);
}

/* App Header */
.app-header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1.1rem 2rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  background: var(--primary-gradient);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: #0f172a;
}

.logo-text h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.nav-links {
  display: flex;
  gap: 0.35rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-family: var(--font-title);
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.nav-link i {
  font-size: 1.15rem;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  padding-left: 1.5rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
}

.user-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.15rem;
  letter-spacing: 0.05em;
}

.user-badge.admin {
  background: rgba(180, 83, 9, 0.08);
  color: var(--admin-badge);
  border: 1px solid rgba(180, 83, 9, 0.15);
}

.user-badge.user {
  background: rgba(3, 105, 161, 0.08);
  color: var(--user-badge);
  border: 1px solid rgba(3, 105, 161, 0.15);
}

/* Premium Buttons */
.btn {
  font-family: var(--font-title);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.875rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-xs {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

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

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
  border: 1.5px solid #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
  background: white;
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

.btn-light {
  background: white;
  color: #0f172a;
  border: 1.5px solid #e2e8f0;
}

.btn-light:hover {
  background: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Spacious, Clean Premium Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-label-highlight {
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #0f172a;
  padding: 0.8rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-input);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), var(--shadow-input);
  background: white;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

/* Drag and Drop File Wrapper */
.file-upload-wrapper {
  position: relative;
  width: 100%;
  border: 2px dashed rgba(79, 70, 229, 0.3);
  border-radius: var(--radius-md);
  padding: 2.75rem 1.5rem;
  text-align: center;
  transition: var(--transition-smooth);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.5);
}

.file-upload-wrapper:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.03);
  box-shadow: 0 10px 25px rgba(15,23,42,0.03);
}

.file-upload-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.file-upload-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.file-upload-trigger i {
  font-size: 3rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition-smooth);
}

.file-upload-wrapper:hover .file-upload-trigger i {
  transform: translateY(-4px) scale(1.05);
}

.file-upload-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.file-upload-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.input-action-wrapper {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  flex-shrink: 0;
}

.mb-2 { margin-bottom: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* Map View Styling (Leaflet) */
.leaflet-map-container {
  height: 230px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e2e8f0;
  z-index: 5;
  background: #f1f5f9;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  overflow: hidden;
}

/* Premium Light Map Feel */
.leaflet-container {
  background: #f8fafc !important;
}

/* Main Container Layouts */
.app-main {
  flex-grow: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ----------------- LOGIN PAGE (WOW Estetika Cerah & Modern) ----------------- */
.login-body {
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem;
}

.login-wrapper {
  width: 100%;
  max-width: 460px;
  animation: pageFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-brand {
  text-align: center;
  margin-bottom: 2.25rem;
}

.brand-icon {
  background: var(--primary-gradient);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

.login-brand h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
  color: #0f172a;
}

.login-brand h2 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-card {
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(255,255,255,0.6);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 0 0 3px 3px;
}

.login-card h3 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 800;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1.3rem;
  color: #94a3b8;
  z-index: 5;
  pointer-events: none;
}

.input-icon-wrapper .form-control {
  padding-left: 2.75rem;
}

.btn-login {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
}

.login-footer-info {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid #e2e8f0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.login-footer-info p {
  margin-bottom: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #0f172a;
}

.login-footer-info p i {
  color: var(--primary);
  font-size: 1rem;
}

.default-accounts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(241, 245, 249, 0.9);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.default-accounts span {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.default-accounts strong {
  color: #0f172a;
}

/* Alerts System */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid transparent;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 1.25rem;
}

.alert-error {
  background: #fef2f2;
  border-color: #fee2e2;
  color: #991b1b;
}

.alert-error i {
  font-size: 1.3rem;
  color: var(--danger);
}

.alert-success {
  background: #ecfdf5;
  border-color: #d1fae5;
  color: #065f46;
}

.alert-success i {
  font-size: 1.3rem;
  color: var(--success);
}

.alert-info {
  background: #f0f9ff;
  border-color: #e0f2fe;
  color: #0369a1;
}

/* ----------------- USER WORKSPACE (Premium Grid) ----------------- */
.workspace-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  animation: pageFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-main {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.panel-section-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  padding-bottom: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-section-title i {
  color: var(--primary);
  font-size: 1.35rem;
}

.control-panel {
  padding: 2rem;
}

.preview-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.canvas-viewport {
  flex-grow: 1;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.03);
}

.canvas-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--glow-gradient) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  opacity: 0.08;
  pointer-events: none;
}

.canvas-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.canvas-placeholder i {
  color: #cbd5e1;
  animation: pulseNeon 2.5s infinite ease-in-out;
}

@keyframes pulseNeon {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0.6; }
}

.canvas-placeholder h4 {
  font-size: 1.2rem;
  color: #0f172a;
  font-weight: 800;
}

.canvas-placeholder p {
  font-size: 0.85rem;
  max-width: 320px;
  color: var(--text-secondary);
}

#timemarkCanvas {
  max-width: 95%;
  max-height: 560px;
  object-fit: contain;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.15);
  border-radius: 8px;
  border: 4px solid white;
}

.action-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

/* History Logs */
.history-section {
  padding: 2.25rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
}

.history-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.02), 0 2px 4px -2px rgba(15, 23, 42, 0.02);
  transition: var(--transition-smooth);
}

.history-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: 0 12px 25px -10px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(79, 70, 229, 0.05);
}

.card-image-wrapper {
  position: relative;
  height: 195px;
  background: #f1f5f9;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.history-card:hover .card-image {
  transform: scale(1.06);
}

.card-image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: var(--transition-smooth);
  backdrop-filter: blur(3px);
}

.card-image-wrapper:hover .card-image-overlay {
  opacity: 1;
}

.card-body {
  padding: 1.35rem;
}

.card-badge {
  background: rgba(79, 70, 229, 0.06);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-family: var(--font-title);
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.85rem;
  letter-spacing: 0.05em;
}

.card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta, .card-note, .card-time {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.card-meta i, .card-note i, .card-time i {
  font-size: 0.95rem;
  color: #94a3b8;
}

.card-time {
  margin-bottom: 0;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1.5px solid #f1f5f9;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.history-empty i {
  color: #cbd5e1;
}

/* ----------------- ADMIN DASHBOARD (Vibrant SaaS Stats) ----------------- */
.admin-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  animation: pageFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.stat-card {
  padding: 1.75rem 2.25rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.stat-card:first-child::before { background: var(--warning); }
.stat-card:last-child::before { background: var(--success); }

.stat-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  color: white;
}

.stat-icon.icon-users {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.stat-icon.icon-photos {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.stat-content h3 {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  color: #0f172a;
}

.stat-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.admin-workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.admin-section {
  padding: 2.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 1.75rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #0f172a;
}

.section-title i {
  color: var(--primary);
  font-size: 1.5rem;
}

.collapsible-form-wrapper {
  margin-bottom: 2.5rem;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-form {
  padding: 1.75rem;
  border-radius: var(--radius-md);
  border: 1.5px solid #e2e8f0;
  background: white;
}

.admin-form h4 {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  border-bottom: 1.5px solid #f1f5f9;
  padding-bottom: 0.65rem;
  color: #0f172a;
}

.form-buttons {
  display: flex;
  gap: 0.85rem;
}

/* Premium SaaS Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.01);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 1.1rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1.5px solid #f1f5f9;
}

.admin-table th {
  font-family: var(--font-title);
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  background: #f8fafc;
}

.admin-table tbody tr {
  transition: var(--transition-smooth);
}

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

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  font-family: var(--font-title);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.badge-admin {
  background: rgba(180, 83, 9, 0.08);
  color: var(--admin-badge);
  border: 1px solid rgba(180, 83, 9, 0.15);
}

.badge-user {
  background: rgba(3, 105, 161, 0.08);
  color: var(--user-badge);
  border: 1px solid rgba(3, 105, 161, 0.15);
}

.status-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.45rem;
}

.status-active {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-inactive {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.table-actions {
  display: flex;
  gap: 0.6rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Audit Table Elements */
.table-image-preview {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.table-image-preview:hover {
  transform: scale(1.08);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.2);
}

.table-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-user-info {
  display: flex;
  flex-direction: column;
}

.user-info-name {
  font-weight: 700;
  color: #0f172a;
}

.user-info-username {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.table-timemark-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 260px;
}

.detail-code {
  font-family: var(--font-title);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
}

.detail-location, .detail-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-coordinates code {
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #047857;
  border: 1px solid #e2e8f0;
}

/* ----------------- FOOTER (Clean & Premium) ----------------- */
.app-footer {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1.75rem 2rem;
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-meta span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-meta i {
  color: var(--success);
}

/* Responsiveness */
@media (max-width: 1100px) {
  .workspace-main {
    grid-template-columns: 1fr;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
  }
  .main-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  .user-profile-menu {
    border-left: none;
    padding-left: 0;
    justify-content: space-between;
  }
  .action-buttons-group {
    grid-template-columns: 1fr;
  }
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
  .footer-meta {
    justify-content: center;
  }
}
