/* ============================================================
   KSS.MANICKBAG.IN — Global Stylesheet
   Theme: Navy (#0b3c5d) + Gold (#f4b41a), same brand as original
   ============================================================ */

:root {
  --navy: #0b3c5d;
  --navy-dark: #082b43;
  --gold: #f4b41a;
  --bg: #f2f6fa;
  --card-radius: 10px;
  --header-h: 200px;
  --userbar-h: 34px;
  --nav-h: 52px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: #222;
}

a { text-decoration: none; color: inherit; }

/* ---------------- TOP BAR (same banner image/behaviour as the original site) ---------------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background-image: url("https://i.postimg.cc/Fsj5XgN7/Boss.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-color: #fff;
  z-index: 200;
  border-bottom: 3px solid var(--gold);
}

.topbar-userbar {
  position: sticky;
  top: var(--header-h);
  z-index: 199;
  background: var(--navy-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 6px 16px;
  font-size: 13px;
  height: var(--userbar-h);
}
.topbar-userbar a, .topbar-userbar button {
  background: none; border: 1px solid rgba(255,255,255,.4);
  color: #fff; padding: 4px 10px; border-radius: 5px; cursor: pointer; font-size: 12px;
}
.topbar-userbar a:hover, .topbar-userbar button:hover { background: var(--gold); color: #000; border-color: var(--gold); }

.header-spacer { height: var(--header-h); }

/* ---------------- NAVBAR ---------------- */
.navbar {
  position: sticky;
  top: calc(var(--header-h) + var(--userbar-h));
  z-index: 198;
  display: flex;
  flex-wrap: wrap;
  background: var(--navy);
}
.menu { position: relative; }
.menu > button, .menu > a.menu-btn {
  background: none; border: none; color: #fff; padding: 14px 18px;
  font-weight: 600; cursor: pointer; font-size: 14px; letter-spacing: .3px;
  display: block; width: 100%; text-align: left;
}
.menu > button:hover, .menu:hover > button { background: var(--gold); color: #000; }

.dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--navy); min-width: 190px; box-shadow: 0 6px 14px rgba(0,0,0,.25); z-index: 50;
}
.menu:hover .dropdown, .menu.open .dropdown { display: block; }

.dropdown button, .dropdown a {
  width: 100%; padding: 10px 14px; border: none; background: none; color: #fff;
  text-align: left; cursor: pointer; font-size: 13.5px; display: block;
}
.dropdown button:hover, .dropdown a:hover { background: var(--gold); color: #000; }

.submenu { position: relative; }
.submenu-dropdown {
  display: none; position: absolute; left: 100%; top: 0; background: var(--navy);
  min-width: 190px; box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.submenu:hover > .submenu-dropdown, .submenu.open > .submenu-dropdown { display: block; }

.scrollable { max-height: 220px; overflow-y: auto; }
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

/* ---------------- CONTENT / INTRO ---------------- */
.content { padding: 18px; max-width: 1500px; margin: 0 auto 0; }

.intro-box {
  background: #fff; border-radius: 12px; padding: 28px; text-align: center;
  border: 2px solid var(--navy);
}
.intro-box img { max-width: 100%; border-radius: 8px; margin-bottom: 16px; }
.intro-box h2 { color: var(--navy); font-size: clamp(22px, 4vw, 34px); margin-bottom: 12px; }
.intro-box p { color: #333; line-height: 1.8; font-size: clamp(14px, 2vw, 18px); max-width: 1100px; margin: 0 auto; }

.section-title {
  color: var(--navy); font-size: 20px; font-weight: 700; margin: 22px 0 10px;
  border-left: 5px solid var(--gold); padding-left: 10px;
}

/* ---------------- AUTO-ADJUSTING LINK GRID ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  background: #fff; border-radius: var(--card-radius); overflow: hidden;
  text-align: center; aspect-ratio: 1 / 1; display: flex; flex-direction: column;
  border: 2px solid var(--navy); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 18px rgba(11,60,93,.25); }
.img-box { flex: 1; background-size: cover; background-position: center; background-color: #eef3f8; }
.card span { padding: 8px 6px; background: var(--navy); color: #fff; font-weight: 600; font-size: 13px; }
.card:hover span { background: var(--gold); color: #000; }

/* Breakpoints — grid auto-adjusts, these just tune density */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
}
@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
  .card span { font-size: 11.5px; padding: 6px 4px; }
}

/* ---------------- MOBILE NAV (hamburger) ---------------- */
.hamburger {
  display: none; background: var(--navy); color: #fff; border: none;
  font-size: 22px; padding: 10px 16px; cursor: pointer; width: 100%; text-align: left;
}
@media (max-width: 900px) {
  :root { --header-h: 110px; }
  .hamburger {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--userbar-h));
    z-index: 198;
  }
  .navbar {
    display: none; flex-direction: column; position: static;
    max-height: calc(100vh - var(--header-h) - var(--userbar-h) - 44px);
    overflow-y: auto;
  }
  .navbar.open { display: flex; }
  .menu { width: 100%; }
  .dropdown, .submenu-dropdown { position: static; box-shadow: none; }
  .submenu-dropdown { left: 0; padding-left: 12px; }
}

/* ---------------- FORMS (login + admin) ---------------- */
.form-card {
  background: #fff; border-radius: 12px; padding: 30px; max-width: 420px;
  margin: 60px auto; box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.form-card h2 { color: var(--navy); text-align: center; margin-bottom: 4px; }
.form-card .sub { text-align: center; color: #666; margin-bottom: 20px; font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px; border-radius: 6px; border: 1px solid #ccc; font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: var(--navy); }
.btn {
  display: inline-block; padding: 11px 22px; background: var(--navy); color: #fff;
  border: none; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.btn:hover { background: var(--gold); color: #000; }
.btn-secondary { background: #6c757d; }
.btn-danger { background: #c0392b; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }

/* ---------------- ADMIN DASHBOARD LAYOUT ---------------- */
.admin-wrap { display: flex; min-height: calc(100vh - var(--header-h)); }
.admin-side {
  width: 230px; background: var(--navy-dark); color: #fff; flex-shrink: 0; padding: 16px 0;
}
.admin-side a {
  display: block; padding: 12px 22px; color: #cfe1ee; font-size: 14px; font-weight: 600;
}
.admin-side a:hover, .admin-side a.active { background: var(--gold); color: #000; }
.admin-main { flex: 1; padding: 24px; min-width: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px; border-left: 5px solid var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-card .lbl { font-size: 13px; color: #666; }

table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
table.data-table th, table.data-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 13.5px; }
table.data-table th { background: var(--navy); color: #fff; }
table.data-table tr:hover { background: #f5f9fc; }

.table-wrap { overflow-x: auto; background: #fff; border-radius: 8px; }

.access-tree { max-height: 380px; overflow-y: auto; border: 1px solid #ddd; border-radius: 8px; padding: 12px; background: #fafcfe; }
.access-tree label { display: block; font-size: 13.5px; padding: 4px 0; }

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

.img-preview { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; border: 1px solid #ccc; background: #eee; }

@media (max-width: 900px) {
  .admin-wrap { flex-direction: column; }
  .admin-side { width: 100%; display: flex; overflow-x: auto; padding: 0; }
  .admin-side a { white-space: nowrap; padding: 12px 16px; }
}
