/* THE RAM Finance — admin theme (overrides Frogetor + per-page Arial styles) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --sb-bg: #f1f5f9;
  --sb-surface: #ffffff;
  --sb-sidebar: #0b1220;
  --sb-sidebar-2: #111827;
  --sb-line: #e2e8f0;
  --sb-text: #0f172a;
  --sb-muted: #64748b;
  --sb-teal: #0d9488;
  --sb-teal-dark: #0f766e;
  --sb-teal-soft: #ccfbf1;
  --sb-navy: #1e3a5f;
  --sb-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --sb-radius: 14px;
  --sb-sidebar-w: 264px;
  --sb-topbar-h: 68px;
}

html {
  background: var(--sb-bg) !important;
}

body.sb-admin {
  margin: 0 !important;
  background: var(--sb-bg) !important;
  color: var(--sb-text) !important;
  font-family: "Inter", system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important;
  overflow-x: hidden;
}

body.sb-admin a {
  color: var(--sb-teal-dark);
}

/* Hide leftover template chrome if a page still emits it */
body.sb-admin .page-wrapper-img,
body.sb-admin .page-wrapper,
body.sb-admin .page-wrapper-inner {
  background: transparent !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

body.sb-admin .page-wrapper-img {
  display: none !important;
}

body.sb-admin .page-content {
  width: 100% !important;
  position: relative !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ===== Sidebar ===== */
.sb-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sb-sidebar-w);
  background: linear-gradient(180deg, var(--sb-sidebar) 0%, #0a1628 100%);
  color: #e2e8f0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sb-brand img {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px 6px;
}

.sb-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sb-brand-text strong {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sb-brand-text span {
  font-size: 11px;
  color: #94a3b8;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
}

.sb-nav::-webkit-scrollbar {
  width: 6px;
}

.sb-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.sb-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 10px 6px;
}

.sb-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sb-nav a i {
  width: 18px;
  font-size: 16px;
  opacity: 0.85;
}

.sb-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff !important;
}

.sb-nav a.is-active {
  background: linear-gradient(90deg, var(--sb-teal), #14b8a6);
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28);
}

.sb-nav a.is-active i {
  opacity: 1;
}

.sb-sidebar-user {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sb-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sb-sidebar-user small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
}

.sb-sidebar-user strong {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* ===== Main + topbar ===== */
.sb-main {
  margin-left: var(--sb-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sb-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--sb-topbar-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sb-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.sb-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sb-menu-btn {
  display: none;
  border: 1px solid var(--sb-line);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--sb-text);
  cursor: pointer;
}

.sb-page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sb-text);
}

.sb-page-sub {
  margin: 0;
  font-size: 12px;
  color: var(--sb-muted);
}

.sb-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.sb-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sb-line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  color: var(--sb-text);
  text-decoration: none !important;
  font-weight: 600;
  font-size: 13px;
}

.sb-user-btn .sb-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.sb-dropdown {
  position: relative;
}

.sb-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  box-shadow: var(--sb-shadow);
  padding: 6px;
  z-index: 20;
}

.sb-dropdown.is-open .sb-dropdown-menu {
  display: block;
}

.sb-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sb-text) !important;
  text-decoration: none !important;
  font-size: 13px;
}

.sb-dropdown-menu a:hover {
  background: #f1f5f9;
}

.sb-content {
  flex: 1;
  padding: 24px;
}

/* ===== Cards / containers / forms / tables ===== */
body.sb-admin .card {
  border: 1px solid var(--sb-line) !important;
  border-radius: var(--sb-radius) !important;
  box-shadow: var(--sb-shadow) !important;
  background: var(--sb-surface) !important;
}

body.sb-admin .card-body {
  padding: 20px !important;
}

body.sb-admin .container,
body.sb-admin .container-fluid {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
}

body.sb-admin .sb-content > .container,
body.sb-admin .page-content .container,
body.sb-admin .sb-content > form,
body.sb-admin .sb-panel {
  background: var(--sb-surface) !important;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius) !important;
  box-shadow: var(--sb-shadow);
  padding: 22px 24px !important;
}

body.sb-admin h1,
body.sb-admin h2,
body.sb-admin h3,
body.sb-admin h4,
body.sb-admin .header-title {
  color: var(--sb-text) !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
}

body.sb-admin h2 {
  font-size: 22px !important;
  margin: 0 0 18px !important;
}

body.sb-admin label {
  font-weight: 600 !important;
  color: #334155 !important;
  font-size: 13px;
  margin-bottom: 4px;
}

body.sb-admin input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body.sb-admin select,
body.sb-admin textarea,
body.sb-admin .form-control,
body.sb-admin .select2-container--default .select2-selection--single {
  width: 100% !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 9px 12px !important;
  min-height: 42px;
  background: #fff !important;
  color: var(--sb-text) !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

body.sb-admin textarea {
  min-height: 84px;
}

body.sb-admin input:focus,
body.sb-admin select:focus,
body.sb-admin textarea:focus,
body.sb-admin .form-control:focus {
  outline: none !important;
  border-color: var(--sb-teal) !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
}

body.sb-admin button,
body.sb-admin .btn,
body.sb-admin input[type="submit"],
body.sb-admin .download-links a {
  background: var(--sb-teal) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 9px 16px !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  cursor: pointer;
  text-decoration: none !important;
  display: inline-block;
  transition: background 0.15s ease, transform 0.1s ease;
}

body.sb-admin button:hover,
body.sb-admin .btn:hover,
body.sb-admin .download-links a:hover {
  background: var(--sb-teal-dark) !important;
}

body.sb-admin button.btn-secondary,
body.sb-admin .btn-secondary {
  background: #334155 !important;
}

body.sb-admin table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid var(--sb-line) !important;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-top: 12px;
}

body.sb-admin table th,
body.sb-admin table td,
body.sb-admin table,
body.sb-admin .dataTable th,
body.sb-admin .dataTable td {
  border: none !important;
  border-bottom: 1px solid var(--sb-line) !important;
  padding: 11px 12px !important;
  text-align: left !important;
  font-size: 13px;
}

body.sb-admin table thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.sb-admin table tbody tr:hover {
  background: #f8fafc;
}

body.sb-admin .dataTables_wrapper {
  padding-top: 8px;
}

body.sb-admin .dataTables_filter input,
body.sb-admin .dataTables_length select {
  min-height: 36px !important;
  width: auto !important;
}

body.sb-admin .select2-container {
  width: 100% !important;
}

/* ===== Dashboard ===== */
.sb-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.sb-hero h1 {
  font-size: 26px !important;
  margin: 0 0 4px !important;
}

.sb-hero p {
  margin: 0;
  color: var(--sb-muted);
}

.sb-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.sb-stat {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.sb-stat::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sb-accent, var(--sb-teal));
}

.sb-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.sb-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sb-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sb-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--sb-soft, var(--sb-teal-soft));
  color: var(--sb-accent, var(--sb-teal));
}

.sb-stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--sb-text);
  line-height: 1.15;
}

.sb-stat.is-invest { --sb-accent: #2563eb; --sb-soft: #dbeafe; }
.sb-stat.is-remain { --sb-accent: #0d9488; --sb-soft: #ccfbf1; }
.sb-stat.is-fine { --sb-accent: #d97706; --sb-soft: #fef3c7; }
.sb-stat.is-clients { --sb-accent: #7c3aed; --sb-soft: #ede9fe; }
.sb-stat.is-given { --sb-accent: #0369a1; --sb-soft: #e0f2fe; }
.sb-stat.is-interest { --sb-accent: #059669; --sb-soft: #d1fae5; }
.sb-stat.is-expense { --sb-accent: #dc2626; --sb-soft: #fee2e2; }
.sb-stat.is-profit { --sb-accent: #4f46e5; --sb-soft: #e0e7ff; }

.sb-footer {
  padding: 8px 24px 22px;
  color: var(--sb-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1035;
}

body.sb-sidebar-open .sb-overlay {
  display: block;
}

/* Login */
body.sb-login {
  min-height: 100vh;
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(13, 148, 136, 0.35), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(37, 99, 235, 0.28), transparent 45%),
    #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sb-login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.sb-login-card img {
  height: 52px;
  display: block;
  margin: 0 auto 10px;
}

.sb-login-card h1 {
  text-align: center;
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: -0.03em;
}

.sb-login-card p {
  text-align: center;
  color: #64748b;
  margin: 0 0 22px;
  font-size: 13px;
}

.sb-login-card label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: #334155;
}

.sb-login-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

.sb-login-card input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
}

.sb-login-card button {
  width: 100%;
  border: 0;
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}

.sb-login-card button:hover {
  background: #0f766e;
}

@media (max-width: 1199px) {
  .sb-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .sb-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sb-sidebar {
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  body.sb-sidebar-open .sb-sidebar {
    transform: none;
  }

  .sb-main {
    margin-left: 0;
  }

  .sb-content {
    padding: 16px;
  }

  .sb-badge {
    display: none;
  }

  .sb-stat-grid {
    grid-template-columns: 1fr;
  }

  .sb-footer {
    flex-direction: column;
    padding: 8px 16px 20px;
  }
}
