/* =========================================================
   GAUGE — Admin Panel Theme
   Design language: "instrument panel" — ink + paper surfaces,
   a single amber signal accent used as a wayfinding "tick",
   monospace numerals for anything measured.
   ========================================================= */

:root{
  /* ---- Palette ---- */
  --ink:        #14181F;
  --ink-soft:   #1E2530;
  --ink-line:   #2A3140;
  --paper:      #F5F6F8;
  --surface:    #FFFFFF;
  --line:       #E3E6EA;
  --text:       #1A1F27;
  --text-muted: #5B6472;
  --slate-50:   #8891A0;

  --amber:      #F2A93B;
  --amber-ink:  #7A4E12;
  --teal:       #1E7A78;
  --teal-ink:   #0F4443;
  --coral:      #E15554;
  --coral-ink:  #7C1F1F;
  --success:    #2F9E62;
  --success-ink:#175A38;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(20,24,31,.06);
  --shadow:    0 4px 16px rgba(20,24,31,.08);

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 66px;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --dur: .18s;
}

[data-theme="dark"]{
  --paper:      #10141B;
  --surface:    #171C25;
  --line:       #262E3B;
  --text:       #EAECEF;
  --text-muted: #9AA3B2;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ -webkit-text-size-adjust: 100%; }

body{
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6, .font-display{
  font-family: var(--font-display);
  letter-spacing: -.01em;
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
a:hover{ color: var(--amber-ink); }

.mono{ font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

::selection{ background: var(--amber); color: var(--ink); }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

::-webkit-scrollbar{ width: 9px; height: 9px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb{ background: var(--ink-line); }

/* =========================================================
   Shell layout
   ========================================================= */

.sidebar{
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--ink);
  color: #C7CCD6;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  transition: width var(--dur) ease, transform var(--dur) ease;
  border-right: 1px solid var(--ink-line);
}

.sidebar-brand{
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--ink-line);
  flex-shrink: 0;
}
.sidebar-brand .mark{
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 8px;
  background: var(--amber);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
}
.sidebar-brand .brand-text{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  white-space: nowrap;
}
.sidebar-brand .brand-text small{
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: .62rem;
  letter-spacing: .12em;
  color: var(--slate-50);
  text-transform: uppercase;
}

.sidebar-nav{
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem .75rem;
}
.nav-section-label{
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #5C6576;
  padding: .9rem .6rem .4rem;
  white-space: nowrap;
}
.sidebar .nav-link{
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .58rem .6rem;
  border-radius: var(--radius-sm);
  color: #C7CCD6;
  font-size: .89rem;
  font-weight: 500;
  position: relative;
  margin-bottom: .15rem;
  white-space: nowrap;
}
.sidebar .nav-link i{ font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar .nav-link:hover{ background: var(--ink-soft); color: #fff; }
.sidebar .nav-link.active{
  background: var(--ink-soft);
  color: #fff;
}
.sidebar .nav-link.active::before{
  content: "";
  position: absolute;
  left: -.75rem; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--amber);
}
.sidebar .nav-link .badge-count{
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .68rem;
}

.sidebar-foot{
  padding: 1rem 1.1rem 1.2rem;
  border-top: 1px solid var(--ink-line);
  flex-shrink: 0;
}
.sidebar-foot .storage-label{
  font-size: .72rem; color: var(--slate-50); margin-bottom: .4rem;
  display: flex; justify-content: space-between; font-family: var(--font-mono);
}
.sidebar-foot .progress{ height: 5px; background: var(--ink-line); }
.sidebar-foot .progress-bar{ background: var(--amber); }

/* Collapsed (desktop) */
.sidebar-collapsed .sidebar{ width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .sidebar-brand .brand-text,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .nav-link .badge-count,
.sidebar-collapsed .sidebar-foot .storage-label,
.sidebar-collapsed .sidebar-foot .progress{ display: none; }
.sidebar-collapsed .sidebar-brand{ justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar .nav-link{ justify-content: center; }
.sidebar-collapsed .sidebar .nav-link i{ width: auto; }
.sidebar-collapsed .main-wrap{ margin-left: var(--sidebar-w-collapsed); }

.main-wrap{
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--dur) ease;
}

.topbar{
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.icon-btn{
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.05rem;
  flex-shrink: 0;
}
.icon-btn:hover{ background: var(--paper); color: var(--text); }
.icon-btn.is-active{ color: var(--amber-ink); border-color: var(--amber); }

.topbar-search{ position: relative; flex: 1 1 auto; max-width: 360px; }
.topbar-search i{ position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--slate-50); }
.topbar-search input{
  width: 100%;
  padding: .5rem .75rem .5rem 2.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: .86rem;
  color: var(--text);
}
.topbar-search input:focus{ outline: none; border-color: var(--amber); background: var(--surface); }

.topbar-spacer{ flex: 1 1 auto; }

.avatar{
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: .8rem;
  flex-shrink: 0;
}
.avatar.sm{ width: 28px; height: 28px; font-size: .68rem; }
.avatar.lg{ width: 56px; height: 56px; font-size: 1.1rem; }

.content{
  padding: 1.6rem;
  flex: 1 1 auto;
}

.page-header{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.page-header .eyebrow{
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber-ink);
  display: block;
  margin-bottom: .3rem;
}
[data-theme="dark"] .page-header .eyebrow{ color: var(--amber); }
.page-header h1{ font-size: 1.5rem; font-weight: 600; margin: 0; }
.page-header .breadcrumb{ margin: 0; padding: 0; background: none; font-size: .8rem; }

.page-footer{
  padding: 1.1rem 1.6rem;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  color: var(--text-muted);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
}

.sidebar-backdrop{
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,12,16,.5);
  z-index: 1025;
}

/* =========================================================
   Panels / Cards
   ========================================================= */

.panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel-head{
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  flex-wrap: wrap;
}
.panel-head h2{ font-size: 1rem; font-weight: 600; margin: 0; }
.panel-head .sub{ font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.panel-body{ padding: 1.3rem; }
.panel-body.p-0{ padding: 0; }

.stat-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--tick, var(--amber));
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.stat-card .eyebrow{
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.stat-card .value{
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 600;
  margin: .35rem 0 .2rem;
  letter-spacing: -.02em;
}
.stat-card .trend{
  font-size: .78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.stat-card .trend.up{ color: var(--success-ink); }
.stat-card .trend.down{ color: var(--coral-ink); }
[data-theme="dark"] .stat-card .trend.up{ color: #5FCB8E; }
[data-theme="dark"] .stat-card .trend.down{ color: #F09090; }
.stat-card .trend span.period{ color: var(--text-muted); font-weight: 400; }

.tick-teal{ --tick: var(--teal); }
.tick-amber{ --tick: var(--amber); }
.tick-coral{ --tick: var(--coral); }
.tick-success{ --tick: var(--success); }

/* =========================================================
   Buttons — retuned to the amber signal
   ========================================================= */

.btn{ font-weight: 500; border-radius: var(--radius-sm); font-size: .87rem; }
.btn-primary{
  --bs-btn-bg: var(--amber);
  --bs-btn-border-color: var(--amber);
  --bs-btn-hover-bg: #E0982B;
  --bs-btn-hover-border-color: #E0982B;
  --bs-btn-active-bg: #CE8A24;
  --bs-btn-active-border-color: #CE8A24;
  color: #241503;
  --bs-btn-hover-color: #241503;
  --bs-btn-active-color: #241503;
}
.btn-outline-primary{
  --bs-btn-color: var(--amber-ink);
  --bs-btn-border-color: var(--amber);
  --bs-btn-hover-bg: var(--amber);
  --bs-btn-hover-border-color: var(--amber);
  --bs-btn-hover-color: #241503;
}
.btn-dark{ background: var(--ink); border-color: var(--ink); }
.btn-teal{ background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover{ background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; }
.btn-ghost{ background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover{ background: var(--paper); }

/* =========================================================
   Badges
   ========================================================= */
.badge{ font-weight: 600; font-size: .72rem; letter-spacing: .01em; padding: .38em .6em; border-radius: 5px; }
.badge-soft-success{ background: rgba(47,158,98,.13); color: var(--success-ink); }
.badge-soft-coral{ background: rgba(225,85,84,.13); color: var(--coral-ink); }
.badge-soft-amber{ background: rgba(242,169,59,.18); color: var(--amber-ink); }
.badge-soft-teal{ background: rgba(30,122,120,.13); color: var(--teal-ink); }
.badge-soft-slate{ background: rgba(91,100,114,.13); color: var(--text-muted); }
[data-theme="dark"] .badge-soft-success{ color: #6FD79A; }
[data-theme="dark"] .badge-soft-coral{ color: #F09090; }
[data-theme="dark"] .badge-soft-amber{ color: var(--amber); }
[data-theme="dark"] .badge-soft-teal{ color: #57C4C1; }

/* =========================================================
   Tables
   ========================================================= */
.table{ color: var(--text); margin-bottom: 0; }
.table > :not(caption) > * > *{ background: transparent; border-bottom-color: var(--line); padding: .8rem .9rem; }
.table thead th{
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table thead th.sortable{ cursor: pointer; user-select: none; }
.table thead th.sortable i{ margin-left: .3rem; font-size: .8rem; opacity: .45; }
.table thead th.sortable.asc i, .table thead th.sortable.desc i{ opacity: 1; color: var(--amber-ink); }
.table tbody tr:hover{ background: var(--paper); }
.row-fading{ opacity: 0; transform: translateX(8px); transition: opacity .25s ease, transform .25s ease; }

.table-toolbar{
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--line);
}
.table-toolbar .search-wrap{ position: relative; flex: 1 1 220px; max-width: 320px; }
.table-toolbar .search-wrap i{ position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--slate-50); font-size: .9rem; }
.table-toolbar .search-wrap input{
  width: 100%; padding: .48rem .7rem .48rem 2rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); font-size: .85rem; color: var(--text);
}
.table-toolbar .search-wrap input:focus{ outline: none; border-color: var(--amber); }

.pager-btn{
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted);
}
.pager-btn.active{ background: var(--ink); color: #fff; border-color: var(--ink); }
.pager-btn:disabled{ opacity: .4; }

/* =========================================================
   Forms
   ========================================================= */
.form-label{ font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.form-label .hint{ font-weight: 400; color: var(--text-muted); }
.form-control, .form-select{
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .88rem;
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
}
.form-control:focus, .form-select:focus{
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(242,169,59,.18);
  background: var(--surface); color: var(--text);
}
.form-text{ font-size: .76rem; }
.form-check-input:checked{ background-color: var(--amber); border-color: var(--amber); }
.form-check-input:focus{ box-shadow: 0 0 0 3px rgba(242,169,59,.18); }
.form-range::-webkit-slider-thumb{ background: var(--amber); }
.form-range::-moz-range-thumb{ background: var(--amber); }
.input-group-text{ background: var(--paper); border-color: var(--line); color: var(--text-muted); }

.upload-drop{
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--paper);
  font-size: .85rem;
}
.upload-drop i{ font-size: 1.6rem; color: var(--amber-ink); display: block; margin-bottom: .5rem; }

/* =========================================================
   Charts
   ========================================================= */
.chart-box{ position: relative; }
.chart-legend-dot{ width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: .4rem; }

/* =========================================================
   Section dividers with tick label (structural device)
   ========================================================= */
.section-tick{
  display: flex; align-items: center; gap: .6rem;
  margin: 2.2rem 0 1rem;
}
.section-tick:first-child{ margin-top: 0; }
.section-tick .bar{ width: 3px; height: 16px; background: var(--amber); border-radius: 2px; flex-shrink: 0; }
.section-tick h2{ font-size: .95rem; font-weight: 600; margin: 0; }
.section-tick .count{ font-family: var(--font-mono); font-size: .74rem; color: var(--text-muted); }

/* =========================================================
   Login page
   ========================================================= */
.auth-shell{ min-height: 100vh; display: flex; }
.auth-side{
  flex: 1 1 42%;
  background: var(--ink);
  color: #C7CCD6;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}
.auth-side .dots{
  position: absolute; right: -60px; bottom: -60px;
  width: 320px; height: 320px;
  background-image: radial-gradient(var(--ink-line) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  opacity: .7;
}
.auth-side .quote{ font-family: var(--font-display); font-size: 1.35rem; line-height: 1.4; max-width: 380px; position: relative; }
.auth-side .quote small{ display:block; margin-top: 1rem; font-family: var(--font-mono); font-size: .74rem; color: var(--slate-50); letter-spacing: .05em; }
.auth-form-side{
  flex: 1 1 58%;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: var(--paper);
}
.auth-card{ width: 100%; max-width: 380px; }
@media (max-width: 900px){ .auth-side{ display: none; } .auth-form-side{ flex: 1 1 100%; } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 991.98px){
  .main-wrap{ margin-left: 0 !important; }
  .sidebar{ transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar-open .sidebar{ transform: translateX(0); }
  .sidebar-open .sidebar-backdrop{ display: block; }
  .topbar-search{ display: none; }
}

@media (max-width: 575.98px){
  .content{ padding: 1rem; }
  .page-header h1{ font-size: 1.25rem; }
  .stat-card .value{ font-size: 1.4rem; }
}



/* ===========================
   Gallery
=========================== */

.gallery-card{
    overflow:hidden;
    border-radius:10px;
}

.gallery-image{
    position:relative;
    overflow:hidden;
}

.gallery-image img{
    width:100%;
    height:160px;
    object-fit:cover;
    transition:.3s;
}

.gallery-card:hover img{
    transform:scale(1.02);
}

.gallery-delete{

    position:absolute;
    top:10px;
    right:10px;

    width:30px;
    height:30px;

    border-radius:50%;

    padding:0;

    display:flex;
    align-items:center;
    justify-content:center;

    opacity:0;
    transition:.25s;
}

.gallery-card:hover .gallery-delete{

    opacity:1;

}
