@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap");

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

body {
  font-family: "DM Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #fefce8 0%, #ffffff 50%, #fdf2f8 100%);
  color: #374151;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header féminin avec gradient */
.header {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 8px 32px rgba(217, 119, 6, 0.2);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.logo-section h1 {
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: linear-gradient(45deg, #ffffff, #fef3c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem 1.5rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.role {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(5px);
}

/* Navigation moderne */
.nav {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(217, 119, 6, 0.1);
  padding: 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.1);
}

.nav-container {
  display: flex;
  padding: 0 2rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 1.5rem;
  text-decoration: none;
  color: #64748b;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  color: #d97706;
  background: rgba(217, 119, 6, 0.05);
  transform: translateY(-2px);
}

.nav-link.active {
  color: #d97706;
  border-bottom-color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  font-weight: 600;
}

/* Main Content */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Cards élégantes */
.card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(217, 119, 6, 0.1);
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(217, 119, 6, 0.15);
}

.card h3 {
  margin-bottom: 1.5rem;
  color: #d97706;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

/* Boutons féminins */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: white;
  text-decoration: none;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.4);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  border-radius: 12px;
}

.quick-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Tables élégantes */
.table-container {
  overflow-x: auto;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.1);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  border-radius: 15px;
  overflow: hidden;
}

.table th {
  padding: 1rem 0.75rem;
  text-align: left;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.table tr:hover {
  background: rgba(217, 119, 6, 0.05);
}

.table tr:nth-child(even) {
  background: rgba(254, 252, 232, 0.5);
}

/* Status avec couleurs féminines */
.status {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-draft {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.status-sent {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}

.status-paid {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
}

.status-cancelled {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
  color: #991b1b;
}

.status-pending {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #3730a3;
}

/* Forms élégants */
.form-group {
  margin-bottom: 1.5rem;
}

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

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

label {
  display: block;
  margin-bottom: 0.75rem;
  color: #374151;
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #f1f5f9;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
  background: white;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Color and Size Tags féminins */
.color-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin: 0.25rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-weight: 500;
  backdrop-filter: blur(5px);
}

.size-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin: 0.25rem;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #475569;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
}

/* Invoice Items */
.invoice-items {
  border: 2px solid #f1f5f9;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 2rem;
  background: white;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 100px 120px auto;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  align-items: end;
  background: white;
  transition: background 0.3s ease;
}

.item-row:nth-child(even) {
  background: rgba(254, 252, 232, 0.5);
}

.item-row:hover {
  background: rgba(217, 119, 6, 0.05);
}

.item-row:last-child {
  border-bottom: none;
}

.remove-item {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.remove-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.add-item {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.add-item:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Invoice View Styles */
.invoice-view {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 12px 40px rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid rgba(217, 119, 6, 0.2);
}

.company-info h2 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.invoice-totals {
  background: linear-gradient(135deg, #fefce8, #fef3c7);
  padding: 2rem;
  border-radius: 15px;
  margin: 2rem 0;
  border: 2px solid rgba(217, 119, 6, 0.1);
}

.invoice-totals .total-final {
  font-size: 1.5rem;
  font-weight: 700;
  border-top: 3px solid #d97706;
  margin-top: 1rem;
  padding-top: 1rem;
  color: #d97706;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.empty-state p {
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

/* Stores Grid */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.store-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.store-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(217, 119, 6, 0.15);
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(217, 119, 6, 0.1);
}

.store-header h3 {
  color: #d97706;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.store-role {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.store-role.admin {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: white;
}

.store-role.store {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

.store-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.store-form .form-group {
  margin-bottom: 0;
}

.store-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

.store-form .form-row .form-group {
  margin-bottom: 0;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 1px solid #10b981;
}

.alert-error {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
  color: #991b1b;
  border: 1px solid #ef4444;
}

.alert-info {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 1px solid #3b82f6;
}

/* Invoice Actions */
.invoice-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.download-pdf {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.download-pdf:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .user-info {
    flex-direction: column;
    gap: 0.5rem;
  }

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

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .item-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav-container {
    flex-direction: column;
    padding: 1rem;
  }

  .nav-link {
    padding: 1rem;
    border-bottom: 1px solid rgba(217, 119, 6, 0.1);
    border-radius: 10px;
    margin-bottom: 0.5rem;
  }

  .main {
    padding: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .invoice-header {
    flex-direction: column;
    gap: 1.5rem;
  }

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

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

  .store-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

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

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

/* Print Styles */
@media print {
  .header,
  .nav,
  .invoice-actions {
    display: none;
  }

  .invoice-view {
    box-shadow: none;
    padding: 0;
    background: white;
  }

  body {
    background: white;
  }
}

/* Animations supplémentaires */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) {
  animation-delay: 0.1s;
}

.card:nth-child(3) {
  animation-delay: 0.2s;
}

/* Effets de survol supplémentaires */
.btn:active {
  transform: translateY(-1px);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link.active::after {
  width: 100%;
}
