/* Azuly — app.css */

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

:root {
  --accent:       #4F6EF7;
  --accent-light: #EEF1FE;
  --accent-dark:  #3A56D4;
  --success:      #16A34A;
  --success-light:#DCFCE7;
  --warning:      #D97706;
  --warning-light:#FEF3C7;
  --danger:       #DC2626;
  --danger-light: #FEE2E2;
  --gray-50:      #F9FAFB;
  --gray-100:     #F3F4F6;
  --gray-200:     #E5E7EB;
  --gray-300:     #D1D5DB;
  --gray-400:     #9CA3AF;
  --gray-500:     #6B7280;
  --gray-600:     #4B5563;
  --gray-700:     #374151;
  --gray-800:     #1F2937;
  --gray-900:     #111827;
  --sidebar-w:    220px;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08);
}

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ─────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .75;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

.nav-item.active svg { opacity: 1; }

.badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 30px; height: 30px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}

.logout-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.logout-btn svg { width: 17px; height: 17px; }
.logout-btn:hover { background: var(--gray-100); color: var(--danger); }

/* ── Main Content ───────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 36px 40px;
  max-width: 1100px;
}

/* ── Flash ──────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
}
.flash-info    { background: var(--accent-light); color: var(--accent-dark); }
.flash-success { background: var(--success-light); color: var(--success); }
.flash-error   { background: var(--danger-light); color: var(--danger); }
.flash-warning { background: var(--warning-light); color: var(--warning); }

/* ── Page Header ────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -.4px;
}

.page-header p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 3px;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
}

.card-body { padding: 22px; }

/* ── Stats Row ──────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-900);
  font-family: 'DM Mono', monospace;
  letter-spacing: -1px;
}

.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* ── Table ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: #fff;
}

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

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

td {
  padding: 12px 16px;
  color: var(--gray-700);
  vertical-align: middle;
}

/* ── Status Pills ───────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-draft     { background: var(--gray-100);    color: var(--gray-500); }
.pill-submitted { background: var(--warning-light); color: var(--warning); }
.pill-approved  { background: var(--success-light); color: var(--success); }
.pill-rejected  { background: var(--danger-light);  color: var(--danger); }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}

.btn:active { transform: scale(.98); }

.btn svg { width: 16px; height: 16px; }

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

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #15803d; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── Forms ──────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

input[type=text],
input[type=email],
input[type=password],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}

textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ── Auth Layout ────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 40px 40px 36px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo .logo-mark {
  width: 36px; height: 36px;
  font-size: 19px;
}

.auth-logo .logo-text {
  font-size: 20px;
}

.auth-card h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

/* ── Report Form ────────────────────────────────── */
.week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.week-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  font-family: 'DM Mono', monospace;
}

.day-block {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow .15s;
}

.day-block:focus-within {
  box-shadow: 0 0 0 3px rgba(79,110,247,.1);
  border-color: var(--gray-300);
}

.day-header {
  padding: 10px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.day-date {
  font-size: 12px;
  color: var(--gray-400);
  font-family: 'DM Mono', monospace;
}

.day-block textarea {
  border: none;
  border-radius: 0;
  padding: 12px 16px;
  font-size: 14px;
  min-height: 70px;
}

.day-block textarea:focus {
  box-shadow: none;
  border-color: transparent;
}

/* ── Report View ────────────────────────────────── */
.report-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-key {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
}

.meta-val {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 500;
}

.entry-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.entry-day {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  margin-bottom: 5px;
}

.entry-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ── Empty State ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-400);
}

.empty-state svg {
  width: 40px; height: 40px;
  margin-bottom: 12px;
  opacity: .4;
}

.empty-state p {
  font-size: 14px;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 20px; }
}

/* ── Tabs ────────────────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--gray-800); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Search-Input ────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.search-wrap svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,.1);
}

/* ── Filter-Chips ────────────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--gray-200); }
.chip.active { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
