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

:root {
  --bg: #f7fafc;
  --card: #ffffff;
  --muted: #6b7280;
  --accent-1: #0ea5e9;
  --accent-2: #2563eb;
  --accent-3: #003366;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-2: rgba(255, 255, 255, 0.85);
  --radius: 12px;
  --shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
}

:root {
  --auth-bg-1: #0b1220;
  --auth-bg-2: #10223f;
  --auth-accent: #f97316;
  --auth-accent-2: #fb923c;
  --auth-text: #f8fafc;
  --auth-muted: #cbd5e1;
  --auth-card: rgba(7, 12, 26, 0.78);
  --auth-border: rgba(148, 163, 184, 0.35);
}

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

html,
body {
  height: 100%;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: #0f172a;
}

h1,
h2,
h3,
.auth-title,
.panel-title {
  font-family: 'Sora', 'Manrope', sans-serif;
}

/* Background image with overlay */
body {
  background-image: url('/static/image.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 15, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: white;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-box {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
}

.subtext {
  margin: 0;
  color: #d1d5db;
  font-size: 14px;
}

.status-badge {
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 14px;
  font-weight: 600;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  flex: 1;
  padding: 0 40px 40px;
}

/* Sidebar */
.sidebar {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 20px 14px;
  border-radius: var(--radius);
  height: fit-content;
  position: sticky;
  top: 24px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group-label {
  margin-top: 8px;
  padding: 8px 12px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.9);
  font-weight: 700;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.98);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.nav-item span {
  font-size: 18px;
}

/* Upload Card */
.upload-card {
  margin-top: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-card h3 {
  margin: 0 0 16px;
  color: white;
  font-size: 16px;
  font-weight: 600;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--glass-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.12);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* Card */
.card {
  background: var(--glass-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 20px;
  font-size: 20px;
  color: #0f172a;
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  transition: background 0.2s;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.8);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 20px;
}

.activity-details {
  flex: 1;
}

.activity-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 14px;
}

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

.activity-action {
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--accent-2);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.activity-action:hover {
  background: var(--accent-1);
}

/* Quick Actions */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(4px);
}

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

/* Report Types */
.report-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.report-card {
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.report-card:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.1);
}

.report-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 32px;
}

.report-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.report-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.btn-generate {
  padding: 10px 20px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-generate:hover {
  transform: scale(1.05);
}

/* Report Output */
.report-output {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.report-content h3 {
  margin: 0 0 16px;
  color: #0f172a;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.report-table th,
.report-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.report-table th {
  background: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  color: #0f172a;
}

.btn-download {
  padding: 12px 24px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

/* Modern Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: #475569;
  color: white;
}

.btn-primary:hover {
  background: #334155;
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: #64748b;
  color: white;
}

.btn-danger:hover {
  background: #475569;
}

.btn-success {
  background: #475569;
  color: white;
}

.btn-success:hover {
  background: #334155;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.7);
  color: #0f172a;
  border: 2px solid rgba(71, 85, 105, 0.3);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(71, 85, 105, 0.6);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* File Input Styling */
.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  margin: 12px 0;
}

.file-input-styled {
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 2px dashed rgba(14, 165, 233, 0.4);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  text-align: center;
  font-weight: 600;
  color: #0f172a;
  transition: all 0.2s;
  cursor: pointer;
}

.file-input-styled:hover {
  border-color: rgba(14, 165, 233, 0.7);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Utility Classes */
.loading-text {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 14px;
}

.error-text {
  color: #ef4444;
  text-align: center;
  padding: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 16px 20px;
  }

  .layout {
    padding: 0 20px 20px;
  }

  .header-left h1 {
    font-size: 20px;
  }

  .stat-value {
    font-size: 24px;
  }
}

/* Auth Screens */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.35;
  pointer-events: none;
}

.auth-shell::before {
  top: -120px;
  left: -90px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
}

.auth-shell::after {
  right: -120px;
  bottom: -140px;
  background: radial-gradient(circle, var(--auth-accent) 0%, transparent 70%);
}

.auth-panel {
  width: 100%;
  max-width: 470px;
  background: var(--auth-card);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  box-shadow: 0 25px 55px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 34px 30px;
  position: relative;
  z-index: 1;
  animation: auth-enter 380ms ease-out;
}

@keyframes auth-enter {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.6px;
  background: linear-gradient(145deg, var(--auth-accent), var(--auth-accent-2));
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.45);
}

.auth-title {
  color: var(--auth-text);
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 8px;
}

.auth-subtitle {
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-alert {
  margin-bottom: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  border-left: 4px solid transparent;
}

.auth-alert.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
  border-left-color: #ef4444;
}

.auth-alert.success,
.auth-alert.info {
  color: #bbf7d0;
  background: rgba(6, 78, 59, 0.45);
  border-left-color: #10b981;
}

.auth-form-row {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  color: var(--auth-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 7px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--auth-border);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.auth-input::placeholder {
  color: rgba(203, 213, 225, 0.68);
}

.auth-input:focus {
  border-color: var(--auth-accent-2);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.auth-input.password {
  padding-right: 52px;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.95) inset !important;
  -webkit-text-fill-color: #fff !important;
}

.auth-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}

.auth-eye:hover {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.14);
}

.auth-hint {
  margin-top: 6px;
  color: #cbd5e1;
  font-size: 12px;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-link {
  color: #fdba74;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.auth-link:hover {
  color: #fed7aa;
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  background: linear-gradient(120deg, var(--auth-accent), var(--auth-accent-2));
  color: #fff;
  border: 0;
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.35);
  margin-top: 4px;
}

.auth-submit:hover {
  background: linear-gradient(120deg, #ea580c, #f97316);
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-footer strong {
  color: #f8fafc;
}

.auth-match {
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
}

.auth-match.ok {
  color: #4ade80;
}

.auth-match.bad {
  color: #fca5a5;
}

@media (max-width: 768px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-panel {
    padding: 26px 18px;
    border-radius: 14px;
  }

  .auth-title {
    font-size: 26px;
  }

  .auth-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* App Shell Upgrade */
.app-topbar {
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.topbar-title {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.topbar-subtitle {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  border-radius: 10px;
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn:hover {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.55);
}

.topbar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.topbar-user:hover {
  border-color: rgba(148, 163, 184, 0.55);
}

.feature-strip {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.08), rgba(249, 115, 22, 0.08));
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
}

.feature-link {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #0f172a;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.feature-link:hover {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.layout-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 18px;
  padding: 18px 20px 24px;
  flex: 1;
  min-height: auto;
}

.sidebar-panel {
  background: rgba(10, 18, 34, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 16px;
}

.main-panel {
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(2, 6, 23, 0.10);
}

.section-hero {
  background: linear-gradient(130deg, rgba(2, 132, 199, 0.92), rgba(234, 88, 12, 0.92));
  border-radius: 14px;
  color: #fff;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.25);
}

.section-hero h2 {
  margin: 0;
  font-size: 24px;
}

.section-hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}

.panel-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
  padding: 20px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
}

.metric-chip {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.9);
}

.metric-chip strong {
  display: block;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.1;
  margin-top: 4px;
}

.metric-chip span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.library-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.library-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.12);
}

.library-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.report-card-modern {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
}

.report-card-modern h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 17px;
}

.report-card-modern p {
  margin: 0 0 14px;
  color: #64748b;
  font-size: 13px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.analytics-kpi {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  padding: 14px;
}

.analytics-kpi h4 {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.analytics-kpi p {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.btn-accent {
  background: linear-gradient(135deg, #ea580c, #fb923c);
  color: white;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #c2410c, #f97316);
}

@media (max-width: 860px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .feature-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .feature-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .icon-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .topbar-user {
    min-height: 44px;
  }

  .library-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-topbar {
    padding: 10px 12px;
  }

  .feature-strip {
    padding: 8px 12px;
  }

  .layout-shell {
    padding: 12px;
  }

  .topbar-subtitle {
    display: none;
  }
}

@media (max-width: 480px) {
  .feature-strip {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .feature-link {
    padding: 10px 14px;
    font-size: 12px;
  }

  .icon-btn {
    padding: 0 10px;
  }

  .library-actions {
    gap: 10px;
  }
}

/* ============================================================
   UX POLISH — Animations, Transitions, Interactive Feedback
   ============================================================ */

/* Smooth page entry for main content */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel, .stat-card, .card {
  animation: fadeSlideIn 0.3s ease forwards;
}

/* Pulse for loading states */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton, [data-loading="true"] {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  color: transparent !important;
  pointer-events: none;
}

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

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e293b;
  color: #f8fafc;
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  font-weight: 500;
  max-width: 380px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-left: 4px solid #0ea5e9;
}

.toast.toast-success { border-left-color: #10b981; }
.toast.toast-error   { border-left-color: #ef4444; }
.toast.toast-warning { border-left-color: #f59e0b; }
.toast.toast-info    { border-left-color: #0ea5e9; }

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  to   { opacity: 0; transform: translateX(40px) scale(0.96); }
}

.toast.dismissing {
  animation: toastOut 0.25s ease forwards;
}

/* Progress indicator bar */
.progress-bar-container {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e40af, #0d9488);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Inline status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.success { background: #dcfce7; color: #15803d; }
.status-badge.error   { background: #fee2e2; color: #dc2626; }
.status-badge.warning { background: #fef9c3; color: #a16207; }
.status-badge.info    { background: #dbeafe; color: #1d4ed8; }
.status-badge.muted   { background: #f1f5f9; color: #64748b; }

/* Clickable row hover */
.clickable-row {
  cursor: pointer;
  transition: background 0.15s;
}

.clickable-row:hover {
  background: #f8fafc;
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #0d9488);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 999;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(30, 64, 175, 0.5);
}

.fab:active {
  transform: scale(0.97);
}

/* Panel tab switcher */
.tab-bar {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  background: white;
  color: #1e40af;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
  color: #1e293b;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f8fafc;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 99;
}

[data-tooltip]:hover::before {
  opacity: 1;
}

/* Metric card pulse on hover */
.analytics-kpi {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.analytics-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.1);
}

/* Search result highlight */
mark {
  background: rgba(255, 235, 59, 0.35);
  border-radius: 3px;
  padding: 0 2px;
  color: inherit;
}

/* Empty state icon upgrade */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 14px;
}

.empty-state::before {
  content: '—';
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  color: #cbd5e1;
}

/* Notification bell indicator */
.notif-dot {
  position: relative;
}

.notif-dot::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid white;
}

/* Consistent button group */
.btn-group {
  display: inline-flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.btn-group .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid #e2e8f0;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: white;
  color: #374151;
  transition: background 0.15s, color 0.15s;
}

.btn-group .btn:last-child {
  border-right: none;
}

.btn-group .btn:hover,
.btn-group .btn.active {
  background: #1e40af;
  color: white;
}

/* Print-friendly styles */
@media print {
  .app-sidebar, .app-topbar, .fab, .toast-container, .btn-group {
    display: none !important;
  }

  .app-content {
    margin: 0;
    padding: 0;
  }

  .panel {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    break-inside: avoid;
  }
}
