/**
 * Tema Admin Piattaforma Cosmetica
 * Estetica premium beauty: cream, rose, gold
 */
:root {
  --cosmesi-cream: #faf8f6;
  --cosmesi-ivory: #f5f0eb;
  --cosmesi-rose: #e8d5d8;
  --cosmesi-rose-dark: #c9a5ab;
  --cosmesi-gold: #c9a962;
  --cosmesi-gold-light: #e8dcc4;
  --cosmesi-charcoal: #2d2a26;
  --cosmesi-muted: #6b6560;
  --cosmesi-border: #e5dfd9;
  --cosmesi-success: #7d9d7a;
  --cosmesi-primary: #a67c6b;
  --cosmesi-sidebar-bg: #2d2a26;
  --cosmesi-sidebar-hover: #3d3935;
  --cosmesi-navbar: linear-gradient(135deg, #2d2a26 0%, #3d3935 100%);
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600&display=swap');

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--cosmesi-cream);
  color: var(--cosmesi-charcoal);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .navbar-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--cosmesi-charcoal);
}

/* Sidebar layout */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--cosmesi-sidebar-bg);
  flex-shrink: 0;
  padding-top: 1rem;
}

.admin-sidebar .brand {
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
}

.admin-sidebar .brand a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.admin-sidebar .brand span {
  color: var(--cosmesi-gold);
  font-weight: 400;
  font-size: 0.85rem;
  display: block;
  margin-top: 2px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.admin-sidebar .nav-link {
  color: rgba(255,255,255,.75);
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}

.admin-sidebar .nav-link:hover {
  color: #fff;
  background: var(--cosmesi-sidebar-hover);
}

.admin-sidebar .nav-link.active {
  color: #fff;
  background: var(--cosmesi-sidebar-hover);
  border-left-color: var(--cosmesi-gold);
}

.admin-sidebar .nav-link i {
  width: 1.5rem;
  margin-right: 0.6rem;
  opacity: .9;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--cosmesi-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-topbar .page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--cosmesi-charcoal);
}

.admin-topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-topbar .user-name {
  font-size: 0.9rem;
  color: var(--cosmesi-muted);
}

.admin-topbar .btn-outline-cosmesi {
  border-color: var(--cosmesi-rose-dark);
  color: var(--cosmesi-charcoal);
  font-size: 0.875rem;
}

.admin-topbar .btn-outline-cosmesi:hover {
  background: var(--cosmesi-rose);
  border-color: var(--cosmesi-rose-dark);
  color: var(--cosmesi-charcoal);
}

.admin-content {
  flex: 1;
  padding: 1.5rem;
}

/* Cards */
.card-cosmesi {
  background: #fff;
  border: 1px solid var(--cosmesi-border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(45,42,38,.04);
  overflow: hidden;
}

.card-cosmesi .card-header {
  background: var(--cosmesi-ivory);
  border-bottom: 1px solid var(--cosmesi-border);
  padding: 0.9rem 1.25rem;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--cosmesi-charcoal);
}

.card-cosmesi .card-body {
  padding: 1.25rem;
}

/* Buttons */
.btn-cosmesi {
  background: var(--cosmesi-primary);
  border-color: var(--cosmesi-primary);
  color: #fff;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
}

.btn-cosmesi:hover {
  background: #8f6b5c;
  border-color: #8f6b5c;
  color: #fff;
}

.btn-gold {
  background: var(--cosmesi-gold);
  border-color: var(--cosmesi-gold);
  color: var(--cosmesi-charcoal);
  font-weight: 500;
  border-radius: 8px;
}

.btn-gold:hover {
  background: #b8954a;
  border-color: #b8954a;
  color: var(--cosmesi-charcoal);
}

.btn-outline-cosmesi {
  border-color: var(--cosmesi-border);
  color: var(--cosmesi-charcoal);
}

.btn-outline-cosmesi:hover {
  background: var(--cosmesi-ivory);
  border-color: var(--cosmesi-rose-dark);
  color: var(--cosmesi-charcoal);
}

/* Tables */
.table-cosmesi {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(45,42,38,.04);
}

.table-cosmesi thead th {
  background: var(--cosmesi-ivory);
  border-bottom: 1px solid var(--cosmesi-border);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cosmesi-muted);
  padding: 0.9rem 1rem;
}

.table-cosmesi tbody td {
  padding: 0.9rem 1rem;
  vertical-align: middle;
  border-color: var(--cosmesi-border);
}

.table-cosmesi tbody tr:hover {
  background: var(--cosmesi-cream);
}

/* Form controls */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--cosmesi-border);
  padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--cosmesi-rose-dark);
  box-shadow: 0 0 0 3px rgba(201,165,171,.2);
}

.form-label {
  font-weight: 500;
  color: var(--cosmesi-charcoal);
  margin-bottom: 0.35rem;
}

/* Alerts */
.alert-success {
  background: rgba(125,157,122,.12);
  border-color: var(--cosmesi-success);
  color: #2d4a2b;
  border-radius: 8px;
}

.alert-danger {
  background: rgba(200,100,100,.1);
  border-radius: 8px;
}

/* Dashboard stats */
.stat-card {
  background: #fff;
  border: 1px solid var(--cosmesi-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: box-shadow .2s, transform .2s;
}

.stat-card:hover {
  box-shadow: 0 8px 24px rgba(45,42,38,.08);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.stat-card .stat-icon.catalogo { background: var(--cosmesi-rose); color: var(--cosmesi-rose-dark); }
.stat-card .stat-icon.magazzino { background: var(--cosmesi-gold-light); color: var(--cosmesi-gold); }
.stat-card .stat-icon.clienti { background: #e0e8d4; color: var(--cosmesi-success); }
.stat-card .stat-icon.ordini { background: #e8e0d4; color: var(--cosmesi-primary); }

.stat-card .stat-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cosmesi-muted);
  margin-bottom: 0.25rem;
}

.stat-card .stat-link {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cosmesi-charcoal);
  text-decoration: none;
  transition: color .2s;
}

.stat-card .stat-link:hover {
  color: var(--cosmesi-primary);
}

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--cosmesi-ivory) 0%, var(--cosmesi-cream) 50%, var(--cosmesi-rose) 100%);
  padding: 2rem;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(45,42,38,.1);
  border: 1px solid var(--cosmesi-border);
  overflow: hidden;
  max-width: 400px;
  width: 100%;
}

.login-card .login-header {
  background: var(--cosmesi-sidebar-bg);
  color: #fff;
  padding: 1.75rem;
  text-align: center;
}

.login-card .login-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.2rem 0;
}

.login-card .login-header p {
  font-size: 0.8rem;
  opacity: .8;
  margin: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-card .card-body {
  padding: 1.75rem;
}

.login-card .btn-cosmesi {
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
}

.login-card .form-control {
  padding: 0.65rem 0.85rem;
}

/* Badges */
.badge-soft {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.75rem;
}

.badge-soft.bg-success { background: rgba(125,157,122,.2); color: var(--cosmesi-success); }
.badge-soft.bg-secondary { background: var(--cosmesi-ivory); color: var(--cosmesi-muted); }

/* Pagination */
.pagination .page-link {
  border-radius: 8px !important;
  border-color: var(--cosmesi-border);
  color: var(--cosmesi-charcoal);
  margin: 0 2px;
}

.pagination .page-item.active .page-link {
  background: var(--cosmesi-primary);
  border-color: var(--cosmesi-primary);
}

/* Nav sidebar mobile */
@media (max-width: 991.98px) {
  .admin-sidebar {
    width: 100%;
    min-height: auto;
  }
  .admin-wrap {
    flex-direction: column;
  }
}
