/**
 * AL BAYAN HIDAYATULLAH MAKASSAR — Base Styles & Layout
 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--ab-ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

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

/* Sidebar Navigation */
.sidebar {
  width: 255px;
  background: linear-gradient(180deg, #102a43 0%, #173f5f 55%, #0e334e 100%);
  color: #ffffff;
  padding: 20px 14px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  box-shadow: 8px 0 28px rgba(16, 42, 67, 0.13);
  z-index: 10;
}

.sidebar .brand {
  font-weight: 800;
  font-size: 20px;
  padding: 8px 10px 22px;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.sidebar .brand span {
  color: #5ea7ff;
}

.nav small {
  display: block;
  color: #8da4be;
  padding: 16px 13px 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
}

.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #dbe8f4;
  padding: 11px 13px;
  border-radius: 11px;
  margin: 2px 0;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.nav button.active {
  background: linear-gradient(90deg, rgba(59, 130, 196, 0.28), rgba(20, 143, 138, 0.16));
  color: #ffffff;
  border-left: 3px solid var(--ab-gold);
  font-weight: 700;
}

/* Main Content Area */
.main {
  margin-left: 255px;
  width: calc(100% - 255px);
  padding: 24px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid var(--ab-line);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.top h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--ab-navy);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.userchip {
  font-size: 12px;
  font-weight: 600;
  color: #475467;
  background: #f2f4f7;
  padding: 8px 12px;
  border-radius: 20px;
}

/* Page Visibility */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Modal System */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.modal.open {
  display: flex;
}

.modalbox {
  background: #ffffff;
  border-radius: 16px;
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
}

.modalhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.modalhead h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ab-navy);
}

.x {
  background: #f2f4f7;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.15s ease;
}

.x:hover {
  background: #e4e7ec;
  color: var(--text);
}

/* Login Screen */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #07111f, #123b6d);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.login-box {
  width: min(430px, 100%);
  background: #ffffff;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
}

.login-brand {
  font-size: 25px;
  font-weight: 900;
  margin-bottom: 6px;
  color: var(--ab-navy);
}

.login-brand span {
  color: #1769aa;
}

.login-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

/* Responsive Base Rules */
@media (max-width: 1000px) {
  .sidebar {
    width: 210px;
  }
  .main {
    margin-left: 210px;
    width: calc(100% - 210px);
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 12px;
  }
  .app {
    display: block;
  }
  .main {
    margin: 0;
    width: 100%;
    padding: 14px;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
  }
  .nav button {
    white-space: nowrap;
    width: auto;
  }
  .nav small {
    display: none;
  }
  .top {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
}
