/* ==================== Root Variables ==================== */
:root {
  --primary: #288098;
  --primary-dark: #1d6275;
  --dark: #212121;
  --accent: #00838F;
  --light: #bfd9dc;
  --lighter: #e8f4f6;
  --white: #FFFFFF;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

/* ==================== Base Styles ==================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--gray-100);
  color: var(--dark);
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  padding: 0 1rem 2rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* ==================== Navigation Bar ==================== */
nav.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-weight: 700;
  font-size: 1.125rem;
  padding: 0.5rem 0;
}

.brand-link:hover {
  color: var(--white);
  opacity: 0.9;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  letter-spacing: -0.025em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  justify-content: space-between;
  margin-left: 3rem;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.nav-link svg {
  opacity: 0.8;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
}

.logout-form {
  display: flex;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: none;
}

/* Hamburger Icon */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
  position: absolute;
}

.hamburger-line:nth-child(1) {
  transform: translateY(-7px);
}

.hamburger-line:nth-child(2) {
  transform: translateY(0);
}

.hamburger-line:nth-child(3) {
  transform: translateY(7px);
}

/* Hamburger animation to X */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translateY(0);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translateY(0);
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.show {
  opacity: 1;
}

/* Mobile menu header - hidden on desktop */
.mobile-menu-header {
  display: none;
}

/* Mobile nav section labels - hidden on desktop */
.mobile-nav-section {
  display: none;
}

/* ==================== Page Header ==================== */
.page-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.page-header-content {
  max-width: 800px;
  margin: 0 auto;
}

.page-header h1 {
  color: var(--dark);
  font-size: 1.75rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.page-header h1 svg {
  color: var(--primary);
}

.page-header h2 {
  color: var(--dark);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--gray-500);
  font-size: 1rem;
  margin: 0.5rem 0 0 0;
}

.page-subtitle {
  color: var(--gray-500);
  font-size: 1rem;
  margin: 0;
}

/* ==================== Alerts / Messages ==================== */
.messages-container {
  max-width: 800px;
  margin: 1rem auto;
  padding: 0 1rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.alert svg {
  flex-shrink: 0;
}

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
}

.alert-close:hover {
  opacity: 1;
  background: none;
  transform: none;
}

.alert-success, .success {
  background-color: var(--success-light);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error, .alert-danger, .error {
  background-color: var(--danger-light);
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ==================== Form Cards ==================== */
.form-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 auto 2rem;
  max-width: 1100px;
  padding: 0 1rem;
}

.form-card {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  flex: 1;
  box-shadow: var(--shadow);
  max-width: 480px;
  min-width: 320px;
  border: 1px solid var(--gray-200);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--lighter);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

.card-header h3 {
  color: var(--dark);
  font-size: 1.1rem;
}

/* ==================== Form Elements ==================== */
.form-group, .input-group {
  margin-bottom: 1.25rem;
}

.input-group label,
.form-group label {
  display: block;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.input-group label svg,
.form-group label svg {
  display: inline;
  vertical-align: middle;
  margin-right: 0.375rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--dark);
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(40, 128, 152, 0.15);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
  color: var(--gray-400);
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  background-color: var(--gray-50);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

input[type="file"]:hover {
  border-color: var(--primary);
  background-color: var(--lighter);
}

input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  margin-right: 1rem;
  transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
  background-color: var(--primary-dark);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* ==================== Buttons ==================== */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--white);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

button:hover, .btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

.btn-accent {
  background-color: var(--accent);
}

.btn-accent:hover {
  background-color: #006d75;
}

.btn-download {
  background-color: var(--primary);
  flex: 1;
}

.btn-delete {
  background-color: var(--danger);
  flex: 1;
}

.btn-delete:hover {
  background-color: #dc2626;
}

/* ==================== Files Section ==================== */
.files-section {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--dark);
  font-size: 1.25rem;
}

.section-header h3 svg {
  color: var(--primary);
}

.file-count {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  padding: 0.375rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ==================== File Grid ==================== */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.file-card {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.file-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--lighter) 0%, var(--light) 100%);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
  line-height: 1.4;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.file-date, .file-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.file-date svg, .file-time svg {
  color: var(--gray-400);
}

.file-uploader {
  margin-top: 0.625rem;
}

.uploader-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--gray-100);
  color: var(--gray-600);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.file-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.delete-form {
  flex: 1;
}

.delete-form .btn-delete {
  width: 100%;
}

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  background-color: var(--white);
  margin: 2rem auto;
  padding: 3rem 2rem;
  max-width: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.empty-icon {
  color: var(--gray-300);
  margin-bottom: 1rem;
}

.empty-state h4 {
  color: var(--dark);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--gray-500);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

/* ==================== Dashboard Styles ==================== */
.dashboard-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.welcome-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  box-shadow: var(--shadow-md);
}

.welcome-content h1 {
  color: var(--white);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.welcome-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin: 0;
  max-width: 500px;
}

.welcome-date {
  text-align: right;
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
}

.date-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.date-value {
  font-size: 1rem;
  font-weight: 600;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--lighter);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

.stat-icon-accent {
  background: #e0f7fa;
  color: var(--accent);
}

.stat-icon-success {
  background: var(--success-light);
  color: var(--success);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.section-title {
  color: var(--dark);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-left: 0.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.dashboard-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.dashboard-card .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--lighter);
  border-radius: var(--radius-sm);
  color: var(--primary);
  flex-shrink: 0;
}

.dashboard-card .card-icon-accent {
  background: #e0f7fa;
  color: var(--accent);
}

.dashboard-card .card-icon-muted {
  background: var(--gray-100);
  color: var(--gray-400);
}

.dashboard-card .card-content {
  flex: 1;
}

.dashboard-card .card-content h3 {
  font-size: 1.1rem;
  color: var(--dark);
  margin-bottom: 0.375rem;
}

.dashboard-card .card-content p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.5;
}

.dashboard-card .card-arrow {
  color: var(--gray-400);
  transition: var(--transition);
}

.dashboard-card:hover .card-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

.dashboard-card.card-disabled {
  opacity: 0.7;
  cursor: default;
}

.dashboard-card.card-disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-200);
}

.coming-soon-badge {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  margin-top: 0.5rem;
}

.help-section {
  margin-top: 1rem;
}

.help-card {
  background: var(--lighter);
  border: 1px solid var(--light);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.help-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--white);
  border-radius: 50%;
  color: var(--primary);
  flex-shrink: 0;
}

.help-content h4 {
  color: var(--dark);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.help-content p {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
}

.help-content a {
  color: var(--primary);
  font-weight: 500;
}

/* ==================== Login Page ==================== */
.login-page {
  min-height: calc(100vh - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--light) 0%, var(--gray-100) 100%);
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  border: 1px solid var(--gray-200);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  color: var(--white);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-md);
}

.login-header h1 {
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--gray-500);
  font-size: 0.95rem;
  margin: 0;
}

.login-form {
  margin-bottom: 1.5rem;
}

.login-form .form-group {
  margin-bottom: 1.25rem;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.login-form label svg {
  color: var(--gray-400);
}

.form-error {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--danger-light);
  color: #991b1b;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  border: 1px solid #fecaca;
}

.btn-login {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-login:hover {
  box-shadow: var(--shadow-md);
}

.login-footer {
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
}

.forgot-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.forgot-link:hover {
  color: var(--primary);
}

.security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--success);
  font-size: 0.8rem;
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: var(--success-light);
  border-radius: var(--radius-sm);
}

/* ==================== Footer ==================== */
footer {
  background-color: var(--dark);
  color: var(--white);
  padding: 2rem 1rem;
  margin-top: auto;
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-brand strong {
  font-size: 1rem;
}

.footer-brand span {
  font-size: 0.8rem;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-copyright {
  width: 100%;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ==================== Django Form Overrides ==================== */
.form-card p {
  margin: 0 0 1rem;
}

.form-card p label {
  display: block;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  /* Prevent scroll when menu is open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
  
  nav.navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .brand-text {
    font-size: 1rem;
  }

  /* Mobile overlay visible */
  .mobile-overlay {
    display: block;
    pointer-events: none;
  }
  
  .mobile-overlay.show {
    pointer-events: auto;
  }

  /* Slide-out drawer menu - FIXED positioning */
  .nav-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for mobile */
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    margin: 0;
    padding: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    overscroll-behavior: contain; /* Prevent scroll chaining */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    /* Prevent text selection and dragging */
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y; /* Only allow vertical scrolling */
  }

  .nav-menu.show {
    transform: translateX(0);
  }
  
  /* Mobile menu header with user info - sticky at top */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
  }
  
  .mobile-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0; /* Allow text truncation */
    flex: 1;
  }
  
  .mobile-user-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px; /* Prevent shrinking */
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
  }
  
  .mobile-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow text truncation */
    flex: 1;
  }
  
  .mobile-user-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .mobile-user-email {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .mobile-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px; /* Prevent shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--transition);
    margin-left: 0.5rem;
  }
  
  .mobile-close-btn:hover,
  .mobile-close-btn:active {
    background: rgba(255, 255, 255, 0.25);
  }
  
  /* Scrollable nav content area */
  .nav-left {
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 0;
    flex: 1;
  }
  
  .nav-right {
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: env(safe-area-inset-bottom, 1rem);
    flex-shrink: 0;
  }
  
  /* Section labels in mobile menu */
  .mobile-nav-section {
    display: block;
    padding: 1rem 1rem 0.5rem;
  }
  
  .mobile-nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.875rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95rem;
  }
  
  .nav-link:hover,
  .nav-link:active {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .nav-link svg {
    width: 20px;
    height: 20px;
    opacity: 0.9;
    flex-shrink: 0;
  }
  
  /* Profile link in nav-right */
  .nav-profile {
    padding: 1rem;
  }
  
  .nav-profile span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .logout-form {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem 1rem;
  }
  
  .logout-button {
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.875rem;
    font-size: 0.95rem;
  }
  
  .logout-button:hover,
  .logout-button:active {
    background: rgba(255, 255, 255, 0.25);
  }

  .hamburger {
    display: flex;
  }

  .welcome-section {
    padding: 1.5rem;
    flex-direction: column;
  }

  .welcome-date {
    text-align: left;
    width: 100%;
  }

  .welcome-content h1 {
    font-size: 1.5rem;
  }

  .form-row {
    padding: 0 0.5rem;
  }

  .form-card {
    min-width: 100%;
  }

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

  .file-actions {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

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

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .login-container {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .page-header h2 {
    font-size: 1.5rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }
}

/* ==================== Mobile-First Enhancements ==================== */
@media (max-width: 768px) {
  /* Larger touch targets */
  button, .btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
  }
  
  /* Better form inputs on mobile */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    min-height: 44px;
  }
  
  /* More compact cards on mobile */
  .dashboard-card {
    padding: 1rem;
  }
  
  .card-grid {
    gap: 0.75rem;
  }
  
  .stats-row {
    gap: 0.75rem;
  }
  
  .stat-card {
    padding: 1rem;
  }
  
  /* Hide profile text on very small screens */
  .nav-profile span {
    display: inline;
  }
  
  /* Compact page headers */
  .page-header {
    padding: 1.5rem 1rem 1rem;
  }
  
  .page-header h1,
  .page-header h2 {
    font-size: 1.375rem;
  }
  
  /* Better footer on mobile */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  /* Analytics section mobile adjustments */
  .analytics-card {
    padding: 1rem;
  }
  
  .admin-quick-actions {
    padding: 1rem;
  }
  
  .admin-action-btn {
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
  }
}

/* Extra small screens (phones) */
@media (max-width: 480px) {
  .brand-text {
    font-size: 0.9rem;
  }
  
  .brand-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .welcome-content h1 {
    font-size: 1.25rem;
  }
  
  .welcome-subtitle {
    font-size: 0.9rem;
  }
  
  .stat-value {
    font-size: 1.25rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
  
  /* Stack buttons on very small screens */
  .section-header-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-bulk-download {
    width: 100%;
    justify-content: center;
  }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
  nav.navbar {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  
  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  
  @media (max-width: 768px) {
    .nav-menu {
      padding-bottom: env(safe-area-inset-bottom);
    }
  }
}

/* Smooth scrolling for better mobile experience */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Dark mode support for status bar */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light dark;
  }
}
