/* 
  style.css — Soft UI Dashboard Theme (Matches 9jaTrust Portal)
  Vanilla CSS, no tailwind/bootstrap dependencies.
*/

:root {
  --primary: #008751; /* NIMC Green */
  --primary-hover: #00683f;
  --secondary: #8392ab;
  --success: #17ad37;
  --info: #17c1e8;
  --warning: #F2A900; /* NIMC Gold */
  --danger: #ea0606;
  --dark: #344767;
  --bg-body: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #67748e;
  --text-dark: #344767;
  --border: #e2e8f0;
  
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-blur: inset 0 0px 1px 1px rgba(254, 254, 254, 0.9), 0 20px 27px 0 rgba(0, 0, 0, 0.05);
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
  --radius-sm: 0.5rem;
  
  --sidebar-width: 250px;
}

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

body {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--secondary); }
.text-dark { color: var(--text-dark); }
.font-weight-bolder { font-weight: 700; }
.mb-0 { margin-bottom: 0 !important; }

/* ── Layout (Sidebar + Main) ────────────────────────────────── */

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

/* Sidebar */
.sidenav {
  width: var(--sidebar-width);
  background: transparent;
  padding: 1rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 99;
  overflow-y: auto;
  transition: all 0.2s ease;
}

.sidenav-inner {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-blur);
  height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.sidenav-header {
  padding: 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.sidenav-header img {
  max-width: 100px;
  height: auto;
}

.navbar-nav {
  list-style: none;
  padding: 1rem 0.5rem;
  flex: 1;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.675rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: rgba(0, 135, 81, 0.05);
  color: var(--text-dark);
}

.nav-link.active {
  background-color: var(--bg-body);
  box-shadow: var(--shadow-soft);
  color: var(--text-dark);
}

.nav-link .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
  margin-right: 10px;
  color: var(--dark);
  transition: all 0.2s ease;
}

.nav-link.active .icon {
  background: linear-gradient(310deg, var(--primary), var(--primary-hover));
  color: #fff;
}

.sidenav-footer {
  padding: 1rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1rem 2rem;
  transition: all 0.2s ease;
  min-width: 0;
}

/* Top Navbar */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.25rem;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  color: var(--text-main);
  font-size: 0.875rem;
}

.breadcrumb-item.active {
  color: var(--text-dark);
  font-weight: 600;
}

.top-navbar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ── Cards & Containers ─────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-blur);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  margin: 0;
}

/* ── Login Page ─────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/img/bg.jpg') no-range center center;
  background-size: cover;
  position: relative;
  /* Cancel out the sidebar push for login page */
  margin-left: calc(-1 * var(--sidebar-width));
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(30px) saturate(100%);
  -webkit-backdrop-filter: blur(30px) saturate(100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-blur);
  padding: 2.5rem 2rem;
  margin: 1rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img {
  max-width: 100px;
  margin-bottom: 1rem;
}

.login-logo h2 {
  color: var(--dark);
  font-weight: 700;
}

/* ── Forms & Buttons ────────────────────────────────────────── */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.4rem;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #d2d6da;
  appearance: none;
  border-radius: var(--radius-md);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.form-control:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 135, 81, 0.25);
}

.btn {
  display: inline-block;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-md);
  transition: all 0.15s ease-in;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(310deg, var(--primary), var(--primary-hover));
  box-shadow: 0 4px 7px -1px rgba(0, 0, 0, 0.11), 0 2px 4px -1px rgba(0, 0, 0, 0.07);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.09), 0 2px 3px -1px rgba(0, 0, 0, 0.07);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-success { background: linear-gradient(310deg, #17ad37, #98ec2d); }
.btn-info { background: linear-gradient(310deg, #2152ff, #21d4fd); }
.btn-warning { background: linear-gradient(310deg, #f53939, #fbcf33); }
.btn-danger { background: linear-gradient(310deg, #ea0606, #ff667c); }

.btn-outline {
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-ghost {
  color: var(--text-main);
}
.btn-ghost:hover {
  color: var(--primary);
}

/* ── Dashboard Stats ────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-blur);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-label {
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  color: var(--text-dark);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

.icon-primary { background: linear-gradient(310deg, var(--primary), var(--primary-hover)); }
.icon-success { background: linear-gradient(310deg, #17ad37, #98ec2d); }
.icon-info { background: linear-gradient(310deg, #2152ff, #21d4fd); }
.icon-warning { background: linear-gradient(310deg, #f53939, #fbcf33); }

/* ── Tables ─────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 0.75rem 1.5rem;
  color: var(--secondary);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-main);
  vertical-align: middle;
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
  padding: 0.35rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge-success { background-color: rgba(130, 214, 22, 0.2); color: #64a611; }
.badge-fail { background-color: rgba(234, 6, 6, 0.2); color: #c10505; }
.badge-admin { background-color: rgba(0, 135, 81, 0.2); color: var(--primary); }
.badge-op { background-color: rgba(23, 193, 232, 0.2); color: #129bb9; }

/* ── NIN Verification Profile ───────────────────────────────── */

.profile-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.photo-box img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.photo-box .placeholder {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--secondary);
}

.name-block h2 {
  margin: 0;
  font-weight: 700;
  color: var(--text-dark);
}

.nin-tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 135, 81, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.875rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  background: var(--bg-body);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.detail-lbl {
  font-size: 0.75rem;
  color: var(--secondary);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.detail-val {
  font-weight: 600;
  color: var(--text-dark);
}

/* ── Form Row & Flash ───────────────────────────────────────── */

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.flash {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.flash-info { background: #fff; color: var(--info); border-left: 4px solid var(--info); }
.flash-success { background: #fff; color: #64a611; border-left: 4px solid var(--success); }
.flash-danger { background: #fff; color: #c10505; border-left: 4px solid var(--danger); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 992px) {
  .hamburger {
    display: block;
  }
  .sidenav {
    transform: translateX(-100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5); /* give it a stronger shadow when opened over content */
  }
  .show-sidebar .sidenav {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .login-page {
    margin-left: 0;
  }
}
