/* =========================================================
   MARMIRO ADMIN CONSOLE - CUSTOM STYLES
   Color Palette: Deep Slate Grey & Marmiro Red (#A31D24)
   Font: Inter
   ========================================================= */

:root {
  --marmiro-red: #A31D24;
  --marmiro-red-hover: #86161C;
  --marmiro-red-subtle: #FDF2F2;
  --marmiro-dark-grey: #1E293B;
  --marmiro-charcoal: #0F172A;
  --marmiro-slate: #64748B;
  --marmiro-border: #E2E8F0;
  --marmiro-bg-light: #F8FAFC;
  --sidebar-width: 250px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1E293B;
  background-color: var(--marmiro-bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Brand Typography & Badges --- */
.brand-title {
  letter-spacing: 0.15em;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--marmiro-red);
  color: #ffffff;
  font-weight: 700;
  border-radius: 6px;
  font-size: 1rem;
}

.brand-badge-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--marmiro-red);
  color: #ffffff;
  font-weight: 700;
  border-radius: 12px;
  font-size: 1.75rem;
  box-shadow: 0 4px 12px rgba(163, 29, 36, 0.25);
}

.small-caption {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.extra-small {
  font-size: 0.75rem;
}

/* --- Buttons & Primary Colors --- */
.btn-primary {
  background-color: var(--marmiro-red);
  border-color: var(--marmiro-red);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--marmiro-red-hover) !important;
  border-color: var(--marmiro-red-hover) !important;
}

.btn-outline-primary {
  color: var(--marmiro-red);
  border-color: var(--marmiro-red);
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
  background-color: var(--marmiro-red);
  border-color: var(--marmiro-red);
  color: #ffffff;
}

.text-danger {
  color: var(--marmiro-red) !important;
}

.bg-danger {
  background-color: var(--marmiro-red) !important;
}

.border-danger {
  border-color: var(--marmiro-red) !important;
}

/* --- Sidebar Layout & Navigation --- */
#wrapper {
  overflow-x: hidden;
}

#sidebar-wrapper {
  min-height: 100vh;
  width: var(--sidebar-width);
  background-color: var(--marmiro-charcoal) !important;
  flex-shrink: 0;
  transition: all 0.25s ease-in-out;
  z-index: 1040;
}

.sidebar-heading {
  height: 64px;
}

#sidebar-wrapper .nav-link {
  color: #94A3B8;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  transition: all 0.15s ease;
}

#sidebar-wrapper .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

#sidebar-wrapper .nav-link.active {
  color: #ffffff;
  background-color: var(--marmiro-red);
  box-shadow: 0 2px 8px rgba(163, 29, 36, 0.35);
}

#sidebar-wrapper .nav-link i {
  font-size: 1.1rem;
}

/* --- Topbar --- */
.topbar {
  height: 64px;
  z-index: 1020;
}

.user-avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--marmiro-border);
  color: var(--marmiro-dark-grey);
}

/* --- Custom Tabs --- */
.custom-tabs .nav-link {
  color: var(--marmiro-slate);
  font-weight: 500;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1.25rem;
  transition: all 0.15s ease;
}

.custom-tabs .nav-link:hover {
  color: var(--marmiro-dark-grey);
  border-bottom-color: var(--marmiro-border);
}

.custom-tabs .nav-link.active {
  color: var(--marmiro-red);
  font-weight: 600;
  border-bottom: 2px solid var(--marmiro-red);
  background: transparent;
}

.custom-pill-nav .nav-link {
  color: var(--marmiro-slate);
  font-weight: 500;
  border-radius: 8px;
  background-color: #F1F5F9;
  border: 1px solid var(--marmiro-border);
  margin: 0 4px;
  font-size: 0.85rem;
}

.custom-pill-nav .nav-link.active {
  background-color: var(--marmiro-dark-grey);
  color: #ffffff;
  border-color: var(--marmiro-dark-grey);
}

/* --- Tables & Cards --- */
.custom-table th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--marmiro-slate);
  padding: 0.85rem 1rem;
  border-top: none;
}

.custom-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

.product-thumb-container, .event-thumb-container {
  width: 48px;
  height: 48px;
  position: relative;
}

.product-thumb, .event-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--marmiro-border);
}

.product-thumb-placeholder, .event-thumb-placeholder {
  width: 48px;
  height: 48px;
  background-color: #F1F5F9;
  border: 1px dashed var(--marmiro-border);
  font-size: 1.25rem;
}

/* --- Form Controls & Switches --- */
.form-control, .form-select {
  border-color: var(--marmiro-border);
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--marmiro-red);
  box-shadow: 0 0 0 0.2rem rgba(163, 29, 36, 0.15);
}

.form-check-input:checked {
  background-color: var(--marmiro-red);
  border-color: var(--marmiro-red);
}

/* --- Media Upload & Previews Grid --- */
.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  min-height: 90px;
}

.media-preview-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--marmiro-border);
  background: #f8fafc;
}

.media-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-card .btn-remove-media {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.media-preview-card .btn-remove-media:hover {
  opacity: 1;
  background: var(--marmiro-red);
}

/* --- Auth Page Styles --- */
.auth-body {
  background: radial-gradient(circle at 50% 20%, #ffffff 0%, #E2E8F0 100%);
}

.auth-card {
  border-radius: 12px;
}

/* --- Shadows & Utilities --- */
.shadow-xs {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* --- Responsive Sidebar (Mobile) --- */
@media (max-width: 767.98px) {
  #sidebar-wrapper {
    position: fixed;
    top: 0;
    left: -260px;
    bottom: 0;
    z-index: 1050;
    transition: left 0.3s ease;
  }

  #sidebar-wrapper.show {
    left: 0;
  }

  #sidebar-backdrop.show {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1045;
  }
}
