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

:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent: #f97316; /* Premium Orange */
  --accent-hover: #ea580c;
  --accent-light: #ffedd5;
  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --glass-blur: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 20px 40px -15px rgba(249, 115, 22, 0.15);
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, hsla(28,100%,74%,0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(28,100%,74%,0.08) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Container */
.app-container {
  max-width: 600px;
  margin: 3rem auto;
  width: 95%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(226, 232, 240, 0.5);
  transition: all 0.3s ease;
}

@media (max-width: 600px) {
  .app-container {
    margin: 0;
    width: 100%;
    border-radius: 0;
    min-height: 100vh;
    border: none;
    box-shadow: none;
    background: var(--bg-card);
  }
}

/* Header */
.header {
  padding: 2rem 2rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #fcd34d);
}

.header-icon {
  width: 52px; 
  height: 52px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 16px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.2);
}
.header-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.header-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Content Area */
.content {
  padding: 2rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}
.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
  background: #ffffff;
}
.form-control::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 1.125rem;
  border: 1px solid transparent; /* default transparent border so size matches secondary button */
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  box-sizing: border-box;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 rgba(249, 115, 22, 0.35);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Dashboard Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.dash-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.dash-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.dash-icon {
  font-size: 2.25rem;
  background: var(--accent-light);
  color: var(--accent);
  width: 68px; 
  height: 68px;
  border-radius: 20px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.1);
  transition: transform 0.3s ease;
}
.dash-card:hover .dash-icon {
  transform: scale(1.1) rotate(5deg);
}
.dash-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

@media (max-width: 400px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* Alerts & Status */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.alert-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: #b91c1c;
}
.alert-success {
  background: var(--success-bg);
  border-color: #a7f3d0;
  color: #047857;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 1.25rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: #f8fafc;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
td {
  font-weight: 500;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* Hidden utility */
.hidden { display: none !important; }

/* Photo Upload row */
.photo-upload {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 1rem 1.25rem; 
  background: #f8fafc;
  border: 2px dashed #cbd5e1; 
  border-radius: 14px;
  transition: all 0.2s;
}
.photo-upload:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.photo-upload input[type="file"] { display: none; }
.photo-label {
  background: #ffffff; 
  color: var(--text-main);
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px; 
  cursor: pointer; 
  font-size: 0.9rem; 
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.photo-label:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.photo-name { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

/* Loader */
.loader-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1000;
}
.spinner {
  width: 54px; height: 54px;
  border: 5px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Navigation Back */
.nav-back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 700;
  margin-bottom: 1.5rem; transition: all 0.2s;
}
.nav-back:hover { 
  color: var(--accent); 
  transform: translateX(-3px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
