@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');
@import url('variables.css');

* { box-sizing: border-box; }

/* Default icon size — prevents any icon() SVG without a specific size rule
   from falling back to the browser's default 300x150 replaced-element size. */
.icon-svg { width: 1em; height: 1em; flex-shrink: 0; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body); background: #F5F6F4; color: var(--tici-ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--tici-aqua); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-body); color: var(--tici-deep-water); margin: 0 0 .3rem; font-weight: 700; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
:focus-visible { outline: 3px solid var(--tici-driftwood); outline-offset: 2px; }

.admin-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 250px; background: var(--tici-deep-water); color: #fff; flex-shrink: 0;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  transform: translateX(-100%); transition: transform .25s var(--ease);
  display: flex; flex-direction: column;
}
.admin-sidebar.open { transform: translateX(0); }
.admin-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-sidebar .brand .logo-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--tici-aqua); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.admin-sidebar .brand .txt { font-weight: 700; font-size: .95rem; line-height: 1.15; }
.admin-sidebar .brand .txt small { display: block; font-weight: 400; font-size: .68rem; opacity: .65; text-transform: uppercase; letter-spacing: 1px; }
.admin-sidebar nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.admin-sidebar .nav-section-label { font-size: .66rem; text-transform: uppercase; letter-spacing: 1px; opacity: .5; padding: 14px 18px 6px; }
.admin-sidebar a.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 18px; color: rgba(255,255,255,.82); font-size: .87rem; font-weight: 500;
  border-left: 3px solid transparent;
}
.admin-sidebar a.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-sidebar a.nav-link:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.admin-sidebar a.nav-link.active { background: rgba(255,255,255,.09); border-left-color: var(--tici-driftwood); color: #fff; }
.admin-sidebar .sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; opacity: .6; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
.sidebar-overlay.show { display: block; }

/* ---- Main area ---- */
.admin-main { flex: 1; min-width: 0; width: 100%; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid #E4E6E2; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.admin-topbar .left { display: flex; align-items: center; gap: 12px; }
.hamburger-btn { background: none; border: none; cursor: pointer; padding: 6px; color: var(--tici-deep-water); }
.admin-topbar h1 { font-size: 1.1rem; margin: 0; }
.admin-topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tici-aqua); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .78rem; }

.admin-content { padding: 20px 18px 60px; max-width: 1400px; }

@media (min-width: 1024px) {
  .admin-sidebar { transform: translateX(0); position: fixed; }
  .admin-main { margin-left: 250px; }
  .hamburger-btn { display: none; }
  .sidebar-overlay { display: none !important; }
}

/* ---- Cards / stats ---- */
.card { background: #fff; border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow-soft); border: 1px solid #E9EAE6; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr; }
.grid.cols-3 { grid-template-columns: 1fr; }
.grid.cols-4 { grid-template-columns: repeat(2,1fr); }
@media (min-width: 720px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3,1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4,1fr); }
}
.stat-card { display: flex; align-items: center; gap: 14px; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--tici-aqua-light); color: var(--tici-aqua); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--tici-deep-water); line-height: 1.1; }
.stat-card .stat-label { font-size: .76rem; color: var(--tici-ink-soft); font-weight: 500; }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: .85rem; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; transition: all .15s var(--ease); text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--tici-aqua); color: #fff; } .btn-primary:hover { background: #166e62; }
.btn-outline { background: #fff; border-color: #D8DBD5; color: var(--tici-deep-water); } .btn-outline:hover { border-color: var(--tici-aqua); background: var(--tici-aqua-light); }
.btn-danger { background: var(--tici-coral); color: #fff; } .btn-danger:hover { background: #a3453a; }
.btn-sm { padding: 6px 11px; font-size: .76rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; text-transform: capitalize; }
.badge-success { background: var(--tici-moss-light); color: #4d6b28; }
.badge-warning { background: var(--tici-amber-light); color: #8a5f0e; }
.badge-danger { background: var(--tici-coral-light); color: #9a382d; }
.badge-muted { background: #EEEAE0; color: var(--tici-ink-soft); }

/* ---- Forms ---- */
.form-group { margin-bottom: 15px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--tici-deep-water); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=tel], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid #D8DBD5; font-family: var(--font-body); font-size: .88rem; background: #fff; color: var(--tici-ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--tici-aqua); outline: none; box-shadow: 0 0 0 3px var(--tici-aqua-light); }
.hint { font-size: .72rem; color: var(--tici-ink-soft); margin-top: 4px; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ---- Table ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; white-space: nowrap; }
table.data-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; color: var(--tici-ink-soft); padding: 9px 12px; border-bottom: 2px solid #E9EAE6; background: #FAFBF9; }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid #EFF1EC; }
table.data-table tr:hover td { background: #FAFBF9; }

/* ---- Alerts ---- */
.alert { padding: 11px 15px; border-radius: 9px; font-size: .85rem; margin-bottom: 15px; }
.alert-success { background: var(--tici-moss-light); color: #3d5a1f; }
.alert-danger { background: var(--tici-coral-light); color: #8a3126; }
.alert-warning { background: var(--tici-amber-light); color: #7a530c; }
.alert-info { background: var(--tici-aqua-light); color: #0e5a4e; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--tici-ink-soft); }
.text-muted { color: var(--tici-ink-soft); }
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-tabs a { padding: 7px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600; background: #fff; border: 1px solid #E4E6E2; color: var(--tici-ink-soft); }
.pill-tabs a.active { background: var(--tici-deep-water); color: #fff; border-color: var(--tici-deep-water); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(11,24,22,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-backdrop.show { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius-md); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: var(--shadow-lifted); }
