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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent: #000000;
  --accent-admin: #ef4444;
  --border: #e2e8f0;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width: 260px;
  --mobile-nav-height: 70px;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Base App Layout */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Desktop) */

.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.25rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 3rem 4rem;
  width: calc(100% - var(--sidebar-width));
}

/* Links & Nav */

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent);
  color: white;
}

.nav-link.active-admin {
  background: var(--accent-admin);
  color: white;
}

/* Sidebar Separator for Desktop Only */

@media (min-width: 1025px) {
  .nav-sep {
    margin-top: 2rem !important;
    border-top: 1px solid var(--border) !important;
    padding-top: 1.5rem !important;
  }
}

/* Tables & Stats */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-minimal {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-minimal {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.table-minimal th {
  background: var(--bg-secondary);
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.table-minimal td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

/* Buttons */

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  border-radius: 99px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
}

.btn-outline:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.btn-minimal {
  background: var(--accent);
  color: white;
  padding: 1.25rem;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-minimal:hover {
  opacity: 0.9;
  transform: scale(0.99);
}

/* Responsive Adjustments */

@media (max-width: 1024px) {
  .sidebar {
    width: 100%;
    height: var(--mobile-nav-height);
    position: fixed;
    top: auto;
    bottom: 0;
    flex-direction: row;
    padding: 0 1rem;
    padding-bottom: env(safe-area-inset-bottom);
    border-right: none;
    border-top: 1px solid var(--border);
    justify-content: center;
    background: white;
  }

  .sidebar-logo {
    display: none;
  }

  .sidebar nav {
    display: flex;
    width: 100%;
    max-width: 500px;
    justify-content: space-around;
    align-items: center;
  }

  .nav-link {
    flex-direction: column;
    gap: 4px;
    padding: 10px 4px;
    /* Balanced padding */
    margin: 0;
    font-size: 0.65rem;
    flex: 1;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    border-top: none !important;
    /* Force remove separator on mobile */
    padding-top: 10px !important;
    /* Reset padding on mobile */
    margin-top: 0 !important;
    /* Reset margin on mobile */
  }

  .nav-link svg {
    width: 20px;
    height: 20px;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem 1rem 100px 1rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start !important;
    margin-bottom: 2rem !important;
  }

  .btn-outline {
    width: 100%;
    justify-content: center;
  }

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

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.input-minimal {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid var(--border);
  font-size: 1.1rem;
  margin-top: 4px;
  background: transparent;
}

.input-minimal:focus {
  outline: none;
  border-color: var(--accent);
}

.label-minimal {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Auth Page */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 20px;
}

.auth-card {
  background: white;
  padding: 30px;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Mobile Specific List Overrides */

.mobile-card-list {
  display: none;
}

@media (max-width: 768px) {
  .mobile-hide-table {
    display: none;
  }

  .mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-log-card {
    background: white;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background 0.2s;
  }

  .mobile-log-card:active {
    background: var(--bg-secondary);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}