/* ═══════════════════════════════════════════════════════════
   HORTECHNET BUSINESS — Admin Design System
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand */
  --red:        #C3010F;
  --red-lt:     #FFF0F1;
  --red-dk:     #980008;
  --blue:       #1481D1;
  --blue-lt:    #EBF5FF;
  --blue-dk:    #0D5FA3;

  /* Admin palette */
  --ink:        #0F172A;
  --ink-muted:  #475569;
  --border:     #E2E8F0;
  --surface:    #F8FAFC;
  --white:      #FFFFFF;
  --sidebar-bg: #0F172A;
  --sidebar-w:  260px;
  --topbar-h:   64px;

  /* Semantic */
  --success:    #059669;
  --success-lt: #ECFDF5;
  --warning:    #D97706;
  --warning-lt: #FFFBEB;
  --danger:     #DC2626;
  --danger-lt:  #FEF2F2;
  --info:       #2563EB;
  --info-lt:    #EFF6FF;

  /* Radius & shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.15);
}

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

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.a-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  transition: transform .3s ease;
}

.a-sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.a-sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; }
.a-sidebar-logo-text { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.a-sidebar-logo-text span { display: block; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.5); }

.a-sidebar-section { padding: 16px 12px 4px; }
.a-sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: rgba(255,255,255,.35); text-transform: uppercase; padding: 0 8px 6px;
}

.a-sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: rgba(255,255,255,.65);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: all .15s;
  margin-bottom: 2px;
}
.a-sidebar-link i { width: 18px; text-align: center; font-size: 13px; }
.a-sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.a-sidebar-link.active { background: var(--red); color: #fff; }
.a-sidebar-link.active i { color: #fff; }

/* ── TOPBAR ──────────────────────────────────────────────── */
.a-topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
}
.a-topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.a-topbar-right { display: flex; align-items: center; gap: 12px; }

.a-topbar-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-muted); cursor: pointer; position: relative;
  transition: all .15s;
}
.a-topbar-icon:hover { background: var(--blue-lt); color: var(--blue); }

.a-notif-badge {
  position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.a-topbar-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--r-sm);
  transition: background .15s;
}
.a-topbar-user:hover { background: var(--surface); }
.a-topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.a-topbar-user-name { font-size: 13px; font-weight: 600; }
.a-topbar-user-role { font-size: 11px; color: var(--ink-muted); }

/* ── CONTENT AREA ────────────────────────────────────────── */
.a-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── CARDS ───────────────────────────────────────────────── */
.a-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.a-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 700;
}
.a-card-body { padding: 22px; }
.a-card-sm .a-card-body { padding: 16px; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.a-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.a-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
}
.a-stat-icon {
  width: 48px; height: 48px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.a-stat-icon.red    { background: var(--red-lt);     color: var(--red); }
.a-stat-icon.blue   { background: var(--blue-lt);    color: var(--blue); }
.a-stat-icon.green  { background: var(--success-lt); color: var(--success); }
.a-stat-icon.yellow { background: var(--warning-lt); color: var(--warning); }

.a-stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.a-stat-label { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.a-stat-change { font-size: 11px; margin-top: 6px; }
.a-stat-change.up   { color: var(--success); }
.a-stat-change.down { color: var(--danger); }

/* ── TABLES ──────────────────────────────────────────────── */
.a-table-wrap { overflow-x: auto; }
.a-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.a-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.a-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.a-table tbody tr:hover { background: #FAFBFC; }
.a-table tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ──────────────────────────────────────────────── */
.a-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.a-badge-green  { background: var(--success-lt); color: var(--success); }
.a-badge-red    { background: var(--danger-lt);  color: var(--danger); }
.a-badge-blue   { background: var(--blue-lt);    color: var(--blue); }
.a-badge-yellow { background: var(--warning-lt); color: var(--warning); }
.a-badge-gray   { background: #F1F5F9;           color: #64748B; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.a-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.a-btn-sm  { padding: 5px 12px; font-size: 12px; }
.a-btn-lg  { padding: 12px 26px; font-size: 15px; }
.a-btn-full { width: 100%; justify-content: center; }

.a-btn-primary { background: var(--blue);  color: #fff; }
.a-btn-primary:hover { background: var(--blue-dk); color: #fff; }

.a-btn-danger  { background: var(--danger-lt); color: var(--danger); border: 1px solid #FECACA; }
.a-btn-danger:hover { background: var(--danger); color: #fff; }

.a-btn-success { background: var(--success-lt); color: var(--success); border: 1px solid #A7F3D0; }
.a-btn-success:hover { background: var(--success); color: #fff; }

.a-btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.a-btn-outline:hover { background: var(--surface); }

.a-btn-red  { background: var(--red); color: #fff; }
.a-btn-red:hover { background: var(--red-dk); color: #fff; }

.a-btn-dark { background: var(--ink); color: #fff; }
.a-btn-dark:hover { background: #1E293B; }

.a-btn.loading { opacity: .7; pointer-events: none; }
.a-btn.loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 6px;
}

/* ── FORMS ───────────────────────────────────────────────── */
.a-form-group { margin-bottom: 18px; }
.a-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.a-label span { color: var(--danger); margin-left: 2px; }

.a-input, .a-select, .a-textarea {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--white); transition: border-color .15s;
  outline: none;
}
.a-input:focus, .a-select:focus, .a-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(20,129,209,.1);
}
.a-textarea { resize: vertical; min-height: 100px; }

.a-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.a-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.a-input-group { display: flex; }
.a-input-group-prefix, .a-input-group-suffix {
  padding: 10px 13px; background: var(--surface);
  border: 1.5px solid var(--border); color: var(--ink-muted);
  font-size: 13px;
}
.a-input-group-prefix { border-right: none; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.a-input-group-suffix { border-left: none; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.a-input-group .a-input { border-radius: 0; flex: 1; }

/* ── DROPZONE ────────────────────────────────────────────── */
.a-dropzone {
  position: relative; border: 2px dashed var(--border);
  border-radius: var(--r-md); background: #FAFAFA;
  padding: 30px; text-align: center; cursor: pointer;
  transition: all .2s;
}
.a-dropzone:hover, .a-dropzone.drag-active {
  border-color: var(--blue); background: var(--blue-lt);
}
.a-dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.a-dropzone i { font-size: 28px; color: var(--ink-muted); margin-bottom: 8px; }
.a-dropzone p { color: var(--ink-muted); font-size: 13px; }
.a-dropzone strong { color: var(--blue); }

/* ── PROGRESS ────────────────────────────────────────────── */
.a-progress-wrap { margin-bottom: 12px; }
.a-progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.a-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.a-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue), #38BDF8);
  border-radius: 3px; transition: width .3s;
}
.a-progress-fill.done  { background: linear-gradient(90deg, var(--success), #34D399); }
.a-progress-fill.error { background: linear-gradient(90deg, var(--danger), #F87171); }
.a-progress-status { font-size: 11px; color: var(--ink-muted); margin-top: 3px; }

/* ── TABS ────────────────────────────────────────────────── */
.a-tabs {
  display: flex; border-bottom: 2px solid var(--border);
  gap: 4px; margin-bottom: 24px;
  overflow-x: auto;
}
.a-tab {
  padding: 10px 18px; border: none; background: none;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--ink-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all .15s;
  white-space: nowrap;
}
.a-tab:hover { color: var(--ink); }
.a-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.a-tab-panel { display: none; }
.a-tab-panel.active { display: block; }

/* ── MODALS ──────────────────────────────────────────────── */
.a-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000; display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.a-modal-overlay.open { display: flex; }

.a-modal {
  background: var(--white); border-radius: var(--r-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.a-modal-xl { max-width: 860px; }
.a-modal-lg { max-width: 700px; }

.a-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  font-size: 16px; font-weight: 700;
}
.a-modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--ink-muted);
  transition: background .15s;
}
.a-modal-close:hover { background: var(--danger-lt); color: var(--danger); }
.a-modal-body { flex: 1; overflow-y: auto; padding: 22px; }
.a-modal-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── TOAST ───────────────────────────────────────────────── */
.a-toast-wrap {
  position: fixed; top: 16px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.a-toast {
  display: flex; gap: 10px; padding: 12px 16px;
  border-radius: var(--r-sm); min-width: 280px; max-width: 360px;
  border: 1px solid; animation: slideIn .25s ease;
  box-shadow: var(--shadow-md);
}
.a-toast-icon { font-size: 15px; margin-top: 1px; }
.a-toast-content { flex: 1; }
.a-toast-title { font-weight: 700; font-size: 13px; }
.a-toast-msg { font-size: 12px; margin-top: 2px; }
.a-toast-close { cursor: pointer; opacity: .6; }
.a-toast-success { background: var(--success-lt); border-color: #A7F3D0; color: #065F46; }
.a-toast-error   { background: var(--danger-lt);  border-color: #FECACA; color: #991B1B; }
.a-toast-info    { background: var(--info-lt);    border-color: #BFDBFE; color: #1E40AF; }
.a-toast-warning { background: var(--warning-lt); border-color: #FDE68A; color: #78350F; }

/* ── SEARCH BAR ──────────────────────────────────────────── */
.a-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface);
  max-width: 300px;
}
.a-search i { color: var(--ink-muted); }
.a-search input { border: none; background: none; outline: none; font-size: 13.5px; width: 100%; }

/* ── FILTER ROW ──────────────────────────────────────────── */
.a-filter-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.a-filter-row .a-select { max-width: 160px; }

/* ── AVATAR ──────────────────────────────────────────────── */
.a-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--blue-lt); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.a-avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.a-empty {
  text-align: center; padding: 60px 20px; color: var(--ink-muted);
}
.a-empty i { font-size: 48px; margin-bottom: 16px; display: block; opacity: .3; }
.a-empty h3 { font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.a-empty p  { font-size: 13px; }

/* ── LOADING OVERLAY ─────────────────────────────────────── */
#loading {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.75);
  z-index: 9000; display: none;
  align-items: center; justify-content: center;
}
#loading.show, #loading[style*="block"] { display: flex; }
.a-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  animation: spin .7s linear infinite;
}

/* ── BREADCRUMB ──────────────────────────────────────────── */
.a-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-muted); margin-bottom: 20px;
}
.a-breadcrumb a { color: var(--blue); text-decoration: none; }
.a-breadcrumb a:hover { text-decoration: underline; }
.a-breadcrumb span { color: var(--border); }

/* ── PAGINATION ──────────────────────────────────────────── */
.a-pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; margin-top: 20px;
}
.a-page-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.a-page-btn:hover, .a-page-btn.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

/* ── PROJECT STAGE ───────────────────────────────────────── */
.a-stage-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.stage-pending    { background: #F1F5F9; color: #64748B; }
.stage-approved   { background: var(--blue-lt); color: var(--blue); }
.stage-planning   { background: #F5F3FF; color: #7C3AED; }
.stage-design_progress { background: #FFF7ED; color: #C2410C; }
.stage-development_progress { background: #ECFDF5; color: #059669; }
.stage-review     { background: var(--warning-lt); color: var(--warning); }
.stage-revision   { background: var(--danger-lt); color: var(--danger); }
.stage-testing    { background: #F0FDF4; color: #16A34A; }
.stage-completed  { background: var(--success-lt); color: var(--success); }

/* ── HAMBURGER ───────────────────────────────────────────── */
.a-hamburger {
  display: none; flex-direction: column; gap: 4px;
  cursor: pointer; padding: 4px;
}
.a-hamburger span {
  width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .2s;
}

/* ── OVERLAY MASK ────────────────────────────────────────── */
.a-sidebar-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 199;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .a-sidebar {
    transform: translateX(-100%);
  }
  .a-sidebar.open {
    transform: none;
  }
  .a-sidebar-mask.open { display: block; }
  .a-topbar { left: 0; padding: 0 16px; }
  .a-content { margin-left: 0; padding: 20px 16px; }
  .a-hamburger { display: flex; }
  .a-form-row, .a-form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
  .a-stats-grid { grid-template-columns: 1fr 1fr; }
  .a-card-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .a-modal { max-width: 100%; margin: 0; max-height: 95vh; border-radius: var(--r-md) var(--r-md) 0 0; }
  .a-modal-overlay { align-items: flex-end; }
}
