/* Panificación Catriel Smart Scale ERP - Clean Light Theme Design System */
:root {
  --bg-main: #F8FAFC;         /* Soft light slate canvas */
  --bg-card: #FFFFFF;         /* Crisp white surface */
  --bg-card-hover: #F1F5F9;   /* Subtle hover state */
  --bg-sidebar: #FFFFFF;      /* Clean white navigation */
  --border-color: #E2E8F0;    /* Light slate borders */
  --border-subtle: #F1F5F9;
  --text-main: #0F172A;       /* Deep slate for maximum contrast and readability */
  --text-muted: #64748B;      /* Medium slate secondary text */
  --primary: #D91A2A;         /* Panificación Catriel Brand Red */
  --primary-hover: #B91C1C;
  --accent-gold: #F59E0B;     /* Catriel Warm Yellow / Gold */
  --accent-gold-light: #FEF3C7;
  --secondary: #0284C7;       /* Clean tech blue */
  --success: #10B981;         /* Emerald green */
  --danger: #EF4444;          /* Red danger */
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.09);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* Sidebar */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
  z-index: 10;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-icon {
  font-size: 26px;
  background: rgba(217, 26, 42, 0.08);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(217, 26, 42, 0.2);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.3px;
}

.brand-title span {
  color: #0F172A;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.sidebar-nav {
  padding: 20px 12px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-category {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 14px 14px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background-color: var(--bg-card-hover);
  color: var(--primary);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(217, 26, 42, 0.08) 0%, rgba(217, 26, 42, 0.02) 100%);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 700;
}

.nav-link .badge-soon {
  margin-left: auto;
  font-size: 9.5px;
  padding: 2px 7px;
  background: #F1F5F9;
  color: #64748B;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid #E2E8F0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FAFAFA;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(217, 26, 42, 0.3);
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  height: 70px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.topbar-title {
  font-size: 19px;
  font-weight: 800;
  color: #0F172A;
}

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

.sync-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 20px;
  font-size: 12px;
  color: #059669;
  font-weight: 700;
}

.sync-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.content-area {
  padding: 32px;
  flex-grow: 1;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(217, 26, 42, 0.3);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-gold));
}

.kpi-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 27px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
}

.kpi-desc {
  font-size: 12px;
  color: #059669;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

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

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #0F172A;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(217, 26, 42, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 26, 42, 0.35);
}

.btn-secondary {
  background: #FFFFFF;
  color: #334155;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.btn-danger:hover {
  background: #DC2626;
  color: #FFFFFF;
}

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

/* Data Tables */
.table-container {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  padding: 12px 16px;
  background-color: #F8FAFC;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: #1E293B;
}

table.data-table tr:hover td {
  background-color: #F8FAFC;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-success {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.badge-warning {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.badge-info {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-danger {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  transform: translateY(-16px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  color: #0F172A;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 26, 42, 0.15);
}

/* Construction Screen */
.construction-card {
  text-align: center;
  padding: 60px 40px;
  max-width: 720px;
  margin: 40px auto;
  background: #FFFFFF;
  border: 1px dashed rgba(217, 26, 42, 0.35);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

.construction-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.roadmap-list {
  text-align: left;
  margin: 30px auto;
  max-width: 500px;
  background: #F8FAFC;
  padding: 20px 24px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.roadmap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: #334155;
  font-weight: 500;
}

.roadmap-item:last-child {
  margin-bottom: 0;
}

.roadmap-check {
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
}
