/* 
  Larvorabio Web Admin Panel CSS 
  Simplified, flat, and modern design system.
  Clean typography, soft borders, and green accents.
*/

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

:root {
  --brand-green: #00A859;
  --brand-dark-green: #008B45;
  --brand-forest: #0a2216;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-on-dark: #f8fafc;
  --radius-md: 8px;
  --radius-sm: 6px;
  --sidebar-width: 260px;
}

/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Authentication Page Styles */
.auth-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: var(--bg-app);
}

.auth-sidebar {
  flex: 1.2;
  background-color: var(--brand-forest);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem;
  color: white;
  text-align: center;
}

.auth-logo-large {
  width: 120px;
  height: 120px;
  margin-bottom: 1.5rem;
}

.auth-title-large {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: white;
}

.auth-desc-large {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.5;
  max-width: 400px;
}

.auth-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-card);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.auth-header {
  margin-bottom: 2rem;
}

.auth-brand-mobile {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-brand-mobile img {
  width: 36px;
  height: 36px;
}

.auth-title {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Forms and Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.form-input:focus {
  border-color: var(--brand-green);
}

.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-custom {
  accent-color: var(--brand-green);
}

.forgot-password {
  color: var(--brand-green);
  font-weight: 500;
}

.forgot-password:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  width: 100%;
}

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

.btn-primary:hover {
  background-color: var(--brand-dark-green);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-hover);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-switch-link {
  color: var(--brand-green);
  font-weight: 600;
}

.auth-switch-link:hover {
  text-decoration: underline;
}

/* Dashboard Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--brand-forest);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
  width: 32px;
  height: 32px;
}

.logo-container img {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.sidebar-menu {
  flex: 1;
  padding: 1rem 0.5rem;
  list-style: none;
  overflow-y: auto;
}

.menu-item {
  margin-bottom: 0.15rem;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  color: #94a3b8;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

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

.menu-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: white;
}

.menu-item.active .menu-link {
  background-color: rgba(0, 168, 89, 0.15);
  color: white;
  font-weight: 600;
}

.menu-item.active svg {
  stroke: var(--brand-green);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: #94a3b8;
}

.logout-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  color: #ef4444;
}

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

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

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

.header-title-section h1 {
  font-size: 1.5rem;
}

.header-title-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--brand-green);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--text-muted);
  width: 14px;
  height: 14px;
}

.icon-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Cards & Metrics Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-details h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.kpi-trend {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kpi-icon-container {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-hover);
  color: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-container svg {
  width: 22px;
  height: 22px;
}

/* Custom Table Controls */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-custom {
  padding: 0.45rem 1.75rem 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 14px;
  cursor: pointer;
  outline: none;
}

.select-custom:focus {
  border-color: var(--brand-green);
}

/* Tables styling */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.table-premium {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.table-premium th {
  background-color: #f8fafc;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.table-premium td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table-premium tr:last-child td {
  border-bottom: none;
}

.table-premium tr:hover {
  background-color: var(--bg-hover);
}

/* Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.status-badge.success { background-color: #dcfce7; color: #15803d; }
.status-badge.success::before { background-color: #15803d; }

.status-badge.warning { background-color: #fef3c7; color: #b45309; }
.status-badge.warning::before { background-color: #b45309; }

.status-badge.info { background-color: #e0f2fe; color: #0369a1; }
.status-badge.info::before { background-color: #0369a1; }

.status-badge.danger { background-color: #fee2e2; color: #b91c1c; }
.status-badge.danger::before { background-color: #b91c1c; }

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 0.35rem;
}

.action-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--brand-green);
  color: var(--brand-green);
}

.action-btn.btn-delete:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

/* Products Grid View */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-image-container {
  height: 140px;
  background-color: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image-placeholder {
  width: 60px;
  height: 60px;
  color: var(--brand-green);
}

.product-category-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: white;
  border: 1px solid var(--border-color);
  color: var(--brand-forest);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
}

.product-details {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  flex: 1;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
}

.product-price {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-green);
}

.product-stock {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
}

.modal-title {
  font-size: 1.05rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Profile Tab Design & Settings */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.profile-card-left {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.profile-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--brand-green);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
}

.profile-name {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.profile-role-badge {
  display: inline-block;
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.profile-meta-info {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  text-align: left;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.meta-label {
  color: var(--text-muted);
}

.meta-value {
  font-weight: 500;
}

/* API Playground / Sandbox */
.api-playground {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.api-route-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.api-route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  background-color: #f8fafc;
}

.api-route-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.api-method {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  color: white;
  width: 48px;
  text-align: center;
}

.api-method.get { background-color: #0284c7; }
.api-method.post { background-color: #16a34a; }

.api-path {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.85rem;
}

.api-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.api-route-details {
  display: none;
  padding: 0.85rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-card);
}

.api-route-box.open .api-route-details {
  display: block;
}

.api-console-title {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.api-console {
  background-color: #0f172a;
  color: #38bdf8;
  font-family: monospace;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.api-sandbox-actions {
  display: flex;
  justify-content: flex-end;
}

.api-sandbox-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  width: auto;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--brand-green);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  min-width: 260px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.toast-error {
  border-left-color: #ef4444;
}

.toast-message {
  font-size: 0.8rem;
  font-weight: 500;
}

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

@media (max-width: 768px) {
  .auth-sidebar {
    display: none;
  }
  
  .auth-brand-mobile {
    display: flex;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .mobile-nav-toggle {
    display: block;
  }
  
  .search-bar {
    display: none;
  }
}
