* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --sidebar-bg: #ffffff;
    --sidebar-text: #475569;
    --bg: #f1f6ff;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    border-right: 1px solid var(--border);
    transition: transform .25s ease;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    padding: 20px;
}

.menu {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.menu-link,
.submenu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    text-align: left;
}

.menu-link:hover,
.submenu-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.menu-link.active,
.submenu-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.menu-toggle .arrow {
    margin-left: auto;
    transition: transform .2s;
}

.menu-group.open .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    padding-left: 30px;
}

.menu-group.open .submenu {
    display: block;
}

.submenu-link {
    font-size: 14px;
    padding: 9px 12px;
}

.logout-form {
    margin: 12px;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #dc2626;
    color: #fff;
}

/* ---------- Main + Header ---------- */
.main {
    flex: 1;
    margin-left: 240px;
    min-width: 0;
}

.header {
    height: 64px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-left h2 {
    font-size: 20px;
    color: var(--primary-dark);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.search {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 240px;
    background: var(--primary-soft);
}

.search:focus,
.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.bell {
    font-size: 20px;
    cursor: pointer;
}

.profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ---------- Content ---------- */
.content {
    padding: 24px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: var(--card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .06);
}

.card:nth-child(2) {
    border-top-color: #0ea5e9;
}

.card:nth-child(3) {
    border-top-color: #6366f1;
}

.card:nth-child(4) {
    border-top-color: #38bdf8;
}

.card p {
    color: var(--muted);
    font-size: 14px;
}

.card h3 {
    font-size: 26px;
    margin: 8px 0;
    color: var(--text);
}

.card small {
    color: var(--muted);
}

.up {
    color: #16a34a !important;
}

.down {
    color: #dc2626 !important;
}

.box {
    background: var(--card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .06);
}

.box h3 {
    margin-bottom: 14px;
    color: var(--primary-dark);
}

.box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.box-head h3 {
    margin: 0;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn.small {
    padding: 5px 12px;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

tbody tr:hover {
    background: #f8fbff;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.success {
    background: #dcfce7;
    color: #15803d;
}

.badge.pending {
    background: #fef3c7;
    color: #b45309;
}

.badge.failed {
    background: #fee2e2;
    color: #b91c1c;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0, 0, 0, .1);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .menu-btn {
        display: block;
    }

    .search {
        display: none;
    }
}
/* ---------- Login Page ---------- */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 50%, #ffffff 100%);
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 5px solid var(--primary);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(37,99,235,.12);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff;
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-brand h1 { font-size: 24px; color: var(--primary-dark); }
.login-brand p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--primary-soft);
  padding: 0 12px;
}
.input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: #fff;
}
.input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-size: 15px;
  color: var(--text);
}
.eye-btn { background: none; border: none; cursor: pointer; font-size: 16px; }

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; cursor: pointer; }
.login-btn { width: 100%; padding: 13px; font-size: 16px; border-radius: 10px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 22px; }

/* ---------- Merchant Form ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.fg label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.fg input, .fg select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}
.fg input:focus, .fg select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.fg.full { grid-column: 1 / -1; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.alert-success {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}
.pager { margin-top: 16px; }
.pager nav svg { width: 18px; height: 18px; }
.btn { text-decoration: none; display: inline-block; }

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 38px; height: 38px;
  background: #fff;
  border-radius: 10px;
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo img { width: 100%; height: 100%; display: block; }
.login-logo-img { display: block; height: 56px; margin: 0 auto 10px; }
