/* =========================================================
 CRIUS COMPRESSOR — admin.css
 Admin Panel Specific Styles (extends app.css tokens)
 ========================================================= */

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {

 /* ── ADMIN SIDEBAR ── */
 .admin-sidebar {
 @apply fixed inset-y-0 left-0 w-64 bg-crius-navy border-r border-white/5
 overflow-y-auto z-40 flex flex-col transition-all duration-300;
 }

 /* Desktop collapsed */
 .admin-sidebar.collapsed { width: 72px; }

 /* Mobile: hide off-screen by default, slide in when open */
 @media (max-width: 767px) {
   .admin-sidebar {
     transform: translateX(-100%);
     width: 260px !important;
     box-shadow: none;
   }
   .admin-sidebar.mobile-open {
     transform: translateX(0);
     box-shadow: 4px 0 32px rgba(0,0,0,0.4);
   }
   /* Reset collapsed on mobile — always show full sidebar when open */
   .admin-sidebar.collapsed {
     width: 260px !important;
   }
 }

 .admin-sidebar-logo {
 @apply flex items-center gap-3 px-5 py-4 border-b border-white/5;
 }
 .admin-sidebar-mark {
 @apply w-9 h-9 bg-crius-blue-light flex items-center justify-center
 font-display font-bold text-[13px] text-white rounded-lg flex-shrink-0;
 }
 .admin-sidebar-brand {
 @apply font-display font-bold text-sm text-white tracking-wide leading-tight;
 }
 .admin-sidebar-ver {
 @apply font-mono text-[11px] text-white/30;
 }

 .admin-nav-group { @apply px-3 py-2; }
 .admin-nav-label { @apply font-mono text-[11px] tracking-[0.2em] text-white/25 px-2 mb-1; }
 .admin-nav-item {
 @apply flex items-center gap-3 px-3 py-2.5 text-[13px] font-display font-medium
 tracking-wide text-white/60 no-underline rounded-lg
 transition-all duration-150 cursor-pointer;
 }
 .admin-nav-item:hover { @apply text-white bg-white/5; }
 .admin-nav-item.active {
 @apply text-white bg-crius-blue-light/15 border-l-2 border-crius-blue-light
 text-crius-blue-light rounded-l-none;
 }
 .admin-nav-icon { @apply w-4 h-4 flex-shrink-0 opacity-70; }
 .admin-nav-item.active .admin-nav-icon { @apply opacity-100; }

 /* Collapsed sidebar: center icons, hide text via x-show */
 .admin-sidebar.collapsed .admin-nav-item {
   @apply justify-center px-0;
 }
 .admin-sidebar.collapsed .admin-nav-group {
   @apply px-1;
 }

 /* ── ADMIN TOPBAR ── */
 .admin-topbar {
 @apply h-16 bg-white border-b border-crius-grey-200 flex items-center
 justify-between px-4 md:px-6 sticky top-0 z-30 gap-4;
 }
 .admin-topbar-title {
 @apply font-display font-bold text-sm text-crius-navy tracking-wide;
 }
 .admin-topbar-right { @apply flex items-center gap-2 md:gap-3 flex-shrink-0; }

 .admin-user-btn {
 @apply flex items-center gap-2 md:gap-2.5 px-2 md:px-3 py-2 rounded-[16px]
 hover:bg-crius-grey-50 transition-all cursor-pointer;
 }
 .admin-user-avatar {
 @apply w-8 h-8 rounded-full bg-crius-navy text-white font-display font-bold
 text-sm flex items-center justify-center flex-shrink-0;
 }
 .admin-user-name { @apply font-display font-medium text-sm text-crius-navy hidden md:block; }

 /* ── ADMIN CONTENT AREA ── */
 .admin-main {
 @apply ml-0 md:ml-64 min-h-screen bg-crius-grey-50 flex flex-col transition-all duration-300;
 }
 .admin-main.sidebar-collapsed { @apply md:ml-[72px]; }

 .admin-page-header {
 @apply bg-white border-b border-crius-grey-200 px-4 md:px-6 py-4 md:py-5
 flex items-start md:items-center justify-between gap-3 flex-wrap;
 }
 .admin-page-title {
 @apply font-display font-bold text-base md:text-lg text-crius-navy tracking-tight;
 }
 .admin-page-content { @apply p-4 md:p-6; }

 /* ── ADMIN STAT WIDGET ── */
 .admin-stat-card {
 @apply bg-white rounded-[20px] border border-crius-grey-200 p-4 md:p-5
 flex items-start gap-3 md:gap-4 shadow-sm hover:shadow-crius-md transition-all;
 }
 .admin-stat-icon {
 @apply w-10 h-10 md:w-12 md:h-12 rounded-[16px] flex items-center justify-center flex-shrink-0;
 }
 .admin-stat-num {
 @apply font-display font-bold text-xl md:text-2xl text-crius-navy leading-none;
 }
 .admin-stat-label {
 @apply font-mono text-xs md:text-sm tracking-wider text-crius-grey-400 mt-1;
 }
 .admin-stat-badge {
 @apply badge font-mono text-[11px];
 }

 /* ── ADMIN DATA TABLE ── */
 .admin-table-card { @apply bg-white rounded-[20px] border border-crius-grey-200 overflow-hidden shadow-sm; }
 .admin-table-head {
 @apply flex items-center justify-between px-4 md:px-5 py-3 md:py-4
 border-b border-crius-grey-100 gap-3 flex-wrap;
 }
 .admin-table-title { @apply font-display font-bold text-sm text-crius-navy; }

 /* Table scrolling on mobile */
 .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
 .admin-table-wrap table { min-width: 600px; width: 100%; }

 /* Override cramped inline table styles */
 .admin-table-card table thead th {
   padding: 12px 14px !important;
   font-size: 12px !important;
   letter-spacing: 0.1em !important;
   white-space: nowrap;
 }
 .admin-table-card table tbody td {
   padding: 12px 14px !important;
   font-size: 13px !important;
 }
 .admin-table-card table tbody td:first-child {
   font-size: 13px !important;
   font-weight: 600;
 }

 @media (min-width: 768px) {
   .admin-table-card table thead th {
     padding: 14px 18px !important;
     font-size: 13px !important;
   }
   .admin-table-card table tbody td {
     padding: 14px 18px !important;
   }
   .admin-table-card table tbody td:first-child {
     font-size: 14px !important;
   }
 }

 /* Action column — force no-wrap, compact buttons */
 .admin-table-actions {
   white-space: nowrap !important;
   width: 1% !important;
   min-width: fit-content;
 }
 .admin-table-actions .action-btn {
   display: inline-flex;
   align-items: center;
   padding: 5px 10px;
   font-size: 11px;
   font-weight: 700;
   letter-spacing: 0.06em;
   border-radius: 50px;
   border: none;
   cursor: pointer;
   transition: all 0.15s;
   text-decoration: none;
   line-height: 1.4;
   white-space: nowrap;
 }
 .admin-table-actions .action-btn:hover { opacity: 0.8; }
 .admin-table-actions .action-btn--edit { background: var(--blue-pale); color: var(--blue); }
 .admin-table-actions .action-btn--spec { background: var(--accent-dim); color: var(--accent-deep); }
 .admin-table-actions .action-btn--img { background: #e8f5ef; color: #1A8050; }
 .admin-table-actions .action-btn--hl { background: #fff8e6; color: #C47B00; }
 .admin-table-actions .action-btn--danger { background: var(--danger-pale); color: var(--danger); }

 /* Icon-only action buttons */
 .admin-table-actions .action-btn { padding: 6px 8px; gap: 0; min-width: 30px; justify-content: center; }
 .admin-table-actions .action-btn svg { display: block; }

 /* Badge sizing in tables */
 .admin-table-card table .badge { font-size: 10px !important; padding: 4px 10px; }
 .badge--inactive { background: #ddd !important; color: #999 !important; }

 /* ── ADMIN FORM CARD ── */
 .admin-form-card { @apply bg-white rounded-[20px] border border-crius-grey-200 overflow-hidden shadow-sm; }
 .admin-form-header { @apply px-4 md:px-6 py-4 border-b border-crius-grey-100 bg-crius-grey-50; }
 .admin-form-section { @apply font-display font-bold text-sm text-crius-navy tracking-wide; }
 .admin-form-body { @apply p-4 md:p-6; }
 .admin-form-footer {
 @apply px-4 md:px-6 py-4 border-t border-crius-grey-100 bg-crius-grey-50
 flex items-center justify-end gap-3 flex-wrap;
 }

 /* ── BREADCRUMB ── */
 .breadcrumb { @apply flex items-center gap-2 flex-wrap; }
 .breadcrumb-item { @apply font-mono text-sm tracking-wider text-crius-grey-400; }
 .breadcrumb-item a { @apply text-crius-blue-light no-underline hover:text-crius-blue; }
 .breadcrumb-sep { @apply text-crius-grey-300 text-sm; }

}

/* ── ADMIN BODY: prevent horizontal scroll ── */
body.admin-body {
  overflow-x: hidden;
}

/* ==========================================================
   ADMIN FORM INPUTS — Light-mode polished styles
   ========================================================== */

/* Label */
body.admin-body .form-label,
body.admin-body label.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 6px;
}
body.admin-body .form-label .req { color: #E11D48; }

/* Base input / textarea / select */
body.admin-body .form-input,
body.admin-body .form-select,
body.admin-body .form-textarea,
body.admin-body input[type="text"].form-input,
body.admin-body input[type="email"].form-input,
body.admin-body input[type="number"].form-input,
body.admin-body input[type="tel"].form-input,
body.admin-body input[type="url"].form-input,
body.admin-body input[type="password"].form-input,
body.admin-body textarea.form-textarea,
body.admin-body select.form-select {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #0F172A;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  line-height: 1.5;
}

body.admin-body .form-input::placeholder,
body.admin-body .form-textarea::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

/* Focus */
body.admin-body .form-input:focus,
body.admin-body .form-select:focus,
body.admin-body .form-textarea:focus {
  border-color: #2684FF;
  box-shadow: 0 0 0 3px rgba(38, 132, 255, 0.15);
  background: #FFFFFF;
}

/* Hover (non-focused) */
body.admin-body .form-input:hover:not(:focus),
body.admin-body .form-select:hover:not(:focus),
body.admin-body .form-textarea:hover:not(:focus) {
  border-color: #94A3B8;
}

/* Textarea */
body.admin-body .form-textarea,
body.admin-body textarea.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.65;
}

/* SELECT — custom arrow + full styling */
body.admin-body .select-wrap {
  position: relative;
}
body.admin-body .select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #64748B;
  pointer-events: none;
  transition: border-top-color 0.15s;
}
body.admin-body .select-wrap:focus-within::after {
  border-top-color: #2684FF;
}
body.admin-body .form-select,
body.admin-body select.form-select {
  padding-right: 40px;
  cursor: pointer;
  background-color: #FFFFFF;
  background-image: none;
}
body.admin-body .form-select option {
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 500;
  padding: 8px 12px;
}
body.admin-body .form-select:focus {
  border-color: #2684FF;
  box-shadow: 0 0 0 3px rgba(38,132,255,0.15);
}

/* Checkbox & Radio */
body.admin-body input[type="checkbox"],
body.admin-body input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #2684FF;
  cursor: pointer;
}

/* Toggle switch */
body.admin-body .toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
body.admin-body .toggle-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
body.admin-body .toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: #CBD5E1;
  border-radius: 50px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
body.admin-body .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: left 0.2s ease;
}
body.admin-body .toggle-wrap input:checked ~ .toggle-track {
  background: #2684FF;
}
body.admin-body .toggle-wrap input:checked ~ .toggle-track .toggle-thumb {
  left: 23px;
}
body.admin-body .toggle-wrap:hover .toggle-track {
  box-shadow: 0 0 0 3px rgba(38,132,255,0.15);
}

/* File input */
body.admin-body input[type="file"].form-input {
  padding: 8px 12px;
  cursor: pointer;
  color: #475569;
  background: #F8FAFC;
  border-style: dashed;
}
body.admin-body input[type="file"].form-input:hover {
  background: #EFF6FF;
  border-color: #2684FF;
}

/* Disabled state */
body.admin-body .form-input:disabled,
body.admin-body .form-select:disabled,
body.admin-body .form-textarea:disabled {
  background: #F1F5F9;
  color: #94A3B8;
  cursor: not-allowed;
  border-color: #E2E8F0;
}

/* Invalid / error */
body.admin-body .form-input.is-error,
body.admin-body .form-select.is-error,
body.admin-body .form-textarea.is-error {
  border-color: #E11D48;
  box-shadow: 0 0 0 3px rgba(225,29,72,0.12);
}

/* Error message */
body.admin-body .form-error {
  font-size: 12px;
  color: #E11D48;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Input group with prefix/suffix */
body.admin-body .input-group {
  display: flex;
  align-items: stretch;
}
body.admin-body .input-group .form-input {
  border-radius: 0 10px 10px 0;
  border-left: none;
}
body.admin-body .input-group-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
}

/* Form section divider label */
body.admin-body .form-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #94A3B8;
  padding: 6px 0 10px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 16px;
}

/* Character counter hint */
body.admin-body .form-hint {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
}

/* ── ADMIN ALERT BANNERS ── */
body.admin-body .alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
body.admin-body .alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
body.admin-body .alert--success { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }
body.admin-body .alert--success svg { color: #16A34A; }
body.admin-body .alert--danger  { background: #FFF1F2; color: #9F1239; border-color: #FECDD3; }
body.admin-body .alert--danger svg { color: #E11D48; }
body.admin-body .alert--warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
body.admin-body .alert--warning svg { color: #D97706; }
body.admin-body .alert--info    { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }
body.admin-body .alert--info svg { color: #2563EB; }

/* Laravel validation errors auto-styling */
body.admin-body .text-red-500,
body.admin-body .text-red-600 {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #E11D48 !important;
  margin-top: 4px;
  display: block;
}

/* ── IMAGE UPLOAD PREVIEW BOX ── */
body.admin-body .img-upload-box {
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #F8FAFC;
}
body.admin-body .img-upload-box:hover {
  border-color: #2684FF;
  background: #EFF6FF;
}
body.admin-body .img-upload-box img {
  max-height: 160px;
  margin: 0 auto 12px;
  border-radius: 8px;
  object-fit: cover;
}
body.admin-body .img-upload-box p {
  font-size: 13px;
  color: #64748B;
  font-weight: 500;
}

/* ── SEARCH INPUT (topbar) ── */
body.admin-body .admin-search {
  position: relative;
  display: flex;
  align-items: center;
}
body.admin-body .admin-search svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #94A3B8;
  pointer-events: none;
}
body.admin-body .admin-search input {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px 8px 36px;
  border: 1.5px solid #E2E8F0;
  border-radius: 50px;
  outline: none;
  color: #0F172A;
  background: #F8FAFC;
  width: 220px;
  transition: all 0.2s;
}
body.admin-body .admin-search input:focus {
  border-color: #2684FF;
  box-shadow: 0 0 0 3px rgba(38,132,255,0.12);
  background: #FFFFFF;
  width: 280px;
}
body.admin-body .admin-search input::placeholder { color: #94A3B8; }

/* ── SMALL TAGS / CHIPS ── */
body.admin-body .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
body.admin-body .chip-blue   { background: #DBEAFE; color: #1D4ED8; }
body.admin-body .chip-green  { background: #DCFCE7; color: #166534; }
body.admin-body .chip-red    { background: #FEE2E2; color: #B91C1C; }
body.admin-body .chip-amber  { background: #FEF3C7; color: #92400E; }
body.admin-body .chip-grey   { background: #F1F5F9; color: #475569; }
body.admin-body .chip svg { width: 12px; height: 12px; }

/* ── ADMIN BUTTON OVERRIDE — light mode ── */
body.admin-body .btn--primary {
  background: #2684FF;
  color: #FFFFFF;
  border-color: transparent;
}
body.admin-body .btn--primary:hover {
  background: #0052CC;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(38,132,255,0.3);
}
body.admin-body .btn--ghost {
  background: #FFFFFF;
  color: #334155;
  border-color: #CBD5E1;
}
body.admin-body .btn--ghost:hover {
  border-color: #2684FF;
  color: #2684FF;
  background: #EFF6FF;
}
body.admin-body .btn--danger {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: transparent;
}
body.admin-body .btn--danger:hover {
  background: #B91C1C;
  color: #FFFFFF;
  transform: translateY(-1px);
}
body.admin-body .btn--sm {
  padding: 7px 16px;
  font-size: 12px;
}

/* ── RICH TEXT / WYSIWYG WRAPPER ── */
body.admin-body .prose-editor {
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  overflow: hidden;
  background: #FFFFFF;
  transition: border-color 0.18s;
}
body.admin-body .prose-editor:focus-within {
  border-color: #2684FF;
  box-shadow: 0 0 0 3px rgba(38,132,255,0.15);
}
body.admin-body .prose-editor .ql-toolbar {
  border: none;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
  padding: 8px 12px;
}
body.admin-body .prose-editor .ql-container {
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #0F172A;
  min-height: 160px;
}
body.admin-body .prose-editor .ql-editor { padding: 14px 16px; }

/* ── PAGINATION (admin) ── */
body.admin-body .admin-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
body.admin-body .admin-pagination a,
body.admin-body .admin-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  text-decoration: none;
  transition: all 0.15s;
}
body.admin-body .admin-pagination a:hover { background: #EFF6FF; border-color: #2684FF; color: #2684FF; }
body.admin-body .admin-pagination .active,
body.admin-body .admin-pagination [aria-current="page"] { background: #2684FF; border-color: #2684FF; color: #FFFFFF; }
body.admin-body .admin-pagination .disabled { opacity: 0.35; cursor: not-allowed; }

/* ── CARD HOVER LIFT ── */
body.admin-body .admin-form-card:focus-within {
  box-shadow: 0 0 0 3px rgba(38,132,255,0.08), 0 4px 24px rgba(0,0,0,0.06);
}
