/* ============================================================
   admin_common.css — LAWSEE ADMIN design system
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, li { margin: 0; padding: 0; list-style: none; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; }
body { display: flex; height: 100vh; background-color: #f4f6f9; color: #333; overflow: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  background-color: #1e2b3c;
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  z-index: 100;
}
.logo {
  padding: 18px 20px;
  font-size: 19px;
  font-weight: bold;
  background-color: #16202c;
  text-align: center;
  letter-spacing: 1px;
}
.logo span { color: #3498db; }
.menu-container { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.menu-group-title {
  padding: 14px 20px 4px;
  font-size: 10px;
  color: #7f8c8d;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.menu { padding-bottom: 4px; }
.menu li a {
  display: block;
  padding: 11px 20px;
  font-size: 13px;
  border-left: 4px solid transparent;
  transition: all 0.2s;
  color: #d1d8e0;
}
.menu li a:hover,
.menu li a.active {
  background-color: #2c3e50;
  color: #fff;
  border-left-color: #3498db;
  font-weight: bold;
}
.sub-menu li a {
  padding: 9px 20px 9px 36px;
  font-size: 12px;
  color: #95a5a6;
}
.sub-menu li a:hover,
.sub-menu li a.active {
  color: #fff;
  background-color: #243346;
  border-left-color: transparent;
}

/* ── Main layout ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}
.header {
  height: 56px;
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 17px; font-weight: bold; }
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: #333;
}
.user-info { font-size: 13px; color: #555; display: flex; align-items: center; gap: 8px; }
.btn-style {
  background-color: #ecf0f1;
  border: 1px solid #bdc3c7;
  padding: 5px 11px;
  border-radius: 4px;
  font-size: 12px;
  color: #333;
}
.btn-style:hover { background-color: #dde1e3; }
.btn-logout {
  background-color: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}
.btn-logout:hover { background-color: #c0392b; }

.content-body {
  padding: 18px 20px;
  background-color: #f4f6f9;
  flex: 1;
}

/* ── Stat cards ───────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.card {
  background-color: #fff;
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border-top: 4px solid #3498db;
}
.card.revenue  { border-top-color: #e67e22; }
.card.alert    { border-top-color: #e74c3c; }
.card.success  { border-top-color: #2ecc71; }
.card-title    { font-size: 12px; color: #7f8c8d; margin-bottom: 8px; font-weight: bold; text-transform: uppercase; letter-spacing: .5px; }
.card-value    { font-size: 26px; font-weight: bold; color: #2c3e50; }
.card-desc     { font-size: 11px; color: #95a5a6; margin-top: 6px; }

/* ── Dashboard boxes ──────────────────────────────────────── */
.dashboard-row { display: flex; gap: 14px; margin-bottom: 18px; }
.box {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 14px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 9px;
  margin-bottom: 10px;
}
.box-title { font-size: 14px; font-weight: bold; color: #333; }
.box-link  { font-size: 12px; color: #3498db; }

/* ── Tables ───────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 400px; }
th, td { padding: 9px 8px; border-bottom: 1px solid #eee; font-size: 12px; white-space: nowrap; }
th { color: #888; font-weight: 600; background-color: #f9f9f9; }
tr:hover td { background-color: #fafbfc; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
}
.bg-blue   { background-color: #3498db; }
.bg-red    { background-color: #e74c3c; }
.bg-green  { background-color: #2ecc71; }
.bg-orange { background-color: #e67e22; }
.bg-gray   { background-color: #95a5a6; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  color: #555;
  background-color: #fff;
  transition: background 0.15s;
}
.pagination a:hover     { background-color: #f0f4f8; }
.pagination .current    { background-color: #3498db; color: #fff; border-color: #3498db; font-weight: bold; }
.pagination .disabled   { color: #ccc; pointer-events: none; }

/* ── Search / filter bar ──────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.search-bar input[type=text],
.search-bar select {
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.search-bar input[type=text] { min-width: 200px; }
.search-bar input[type=text]:focus,
.search-bar select:focus { border-color: #3498db; }
.btn-search {
  padding: 7px 16px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
}
.btn-search:hover { background-color: #2980b9; }
.btn-reset {
  padding: 7px 12px;
  background-color: #ecf0f1;
  color: #555;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}
.btn-reset:hover { background-color: #dde1e3; }

/* ── Sections & detail layout ─────────────────────────────── */
.section-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 18px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 15px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.detail-grid { display: grid; grid-template-columns: 140px 1fr; gap: 10px 0; }
.detail-label { font-size: 12px; color: #888; font-weight: bold; padding: 6px 0; }
.detail-value { font-size: 13px; color: #333; padding: 6px 0; border-bottom: 1px solid #f5f5f5; }

/* ── Overlay (mobile) ─────────────────────────────────────── */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.overlay.active { display: block; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
  }
  .hamburger-btn { display: block; }
  .header-title  { font-size: 15px; }
  .user-info span { display: none; }
  .card-grid      { grid-template-columns: 1fr 1fr; }
  .dashboard-row  { flex-direction: column; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
}
