/* AgroSupply Match - CSS Mobile-First */

/* Variáveis CSS */
:root {
  --primary-color: #2e7d32;
  --secondary-color: #4caf50;
  --accent-color: #8bc34a;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --success-color: #4caf50;
  --info-color: #2196f3;
  --dark-color: #1b5e20;
  --light-color: #f1f8e9;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;

  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-100);
  font-size: 16px;
}

/* Container Principal */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    max-width: 1200px;
    padding: 0 24px;
  }
}

/* Header Mobile */
.header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--white);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 18px;
}

/* Menu Mobile */
.menu-toggle {
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 1001;
  overflow-y: auto;
}

.nav-menu.active {
  left: 0;
}

.nav-header {
  background: var(--primary-color);
  color: var(--white);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
}

.nav-list {
  list-style: none;
  padding: 20px 0;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--gray-700);
  text-decoration: none;
  transition: var(--transition);
  border-left: 4px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: var(--light-color);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content */
.main-content {
  padding: 20px 0;
  min-height: calc(100vh - 80px);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 16px 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: -10px;
}

.col {
  flex: 1;
  padding: 10px;
  min-width: 0;
}

.col-12 {
  flex: 0 0 100%;
}
.col-6 {
  flex: 0 0 50%;
}
.col-4 {
  flex: 0 0 33.333%;
}
.col-3 {
  flex: 0 0 25%;
}

@media (max-width: 767px) {
  .col-sm-12 {
    flex: 0 0 100%;
  }
  .col-sm-6 {
    flex: 0 0 50%;
  }
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--dark-color);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-500);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--gray-600);
}

.btn-success {
  background: var(--success-color);
  color: var(--white);
}

.btn-warning {
  background: var(--warning-color);
  color: var(--white);
}

.btn-danger {
  background: var(--danger-color);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  min-height: 36px;
}

.btn-lg {
  padding: 16px 24px;
  font-size: 16px;
  min-height: 52px;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition);
  background: var(--white);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--white);
}

.stat-icon.primary {
  background: var(--primary-color);
}
.stat-icon.success {
  background: var(--success-color);
}
.stat-icon.warning {
  background: var(--warning-color);
}
.stat-icon.info {
  background: var(--info-color);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--gray-600);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: var(--primary-color);
  color: var(--white);
}
.badge-success {
  background: var(--success-color);
  color: var(--white);
}
.badge-warning {
  background: var(--warning-color);
  color: var(--white);
}
.badge-danger {
  background: var(--danger-color);
  color: var(--white);
}
.badge-info {
  background: var(--info-color);
  color: var(--white);
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border-left: 4px solid;
}

.alert-success {
  background: #e8f5e8;
  color: var(--success-color);
  border-left-color: var(--success-color);
}

.alert-warning {
  background: #fff3e0;
  color: var(--warning-color);
  border-left-color: var(--warning-color);
}

.alert-danger {
  background: #ffebee;
  color: var(--danger-color);
  border-left-color: var(--danger-color);
}

.alert-info {
  background: #e3f2fd;
  color: var(--info-color);
  border-left-color: var(--info-color);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-300);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Utilities */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 8px;
}
.mt-2 {
  margin-top: 16px;
}
.mt-3 {
  margin-top: 24px;
}
.mt-4 {
  margin-top: 32px;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 8px;
}
.mb-2 {
  margin-bottom: 16px;
}
.mb-3 {
  margin-bottom: 24px;
}
.mb-4 {
  margin-bottom: 32px;
}

.p-0 {
  padding: 0;
}
.p-1 {
  padding: 8px;
}
.p-2 {
  padding: 16px;
}
.p-3 {
  padding: 24px;
}
.p-4 {
  padding: 32px;
}

.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}

.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.align-center {
  align-items: center;
}

.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

/* Responsive */
@media (max-width: 767px) {
  .d-sm-none {
    display: none;
  }
  .d-sm-block {
    display: block;
  }
}

@media (min-width: 768px) {
  .d-md-none {
    display: none;
  }
  .d-md-block {
    display: block;
  }
  .d-md-flex {
    display: flex;
  }
}
