/* =========================
   WhoOwesMe - Professional UI
   ========================= */

:root{
  --app-bg: #f5f7fb;
  --app-bg2: #eef2ff;
  --card-bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --footer-h: 56px;
}

/* Base */
html, body{ height:100%; }
body.app-body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, var(--app-bg2), transparent 60%),
              radial-gradient(1200px 600px at 90% 10%, #e0f2fe, transparent 55%),
              var(--app-bg);
  color: var(--text);
}

html[lang="ar"] body.app-body{
  font-family: Cairo, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ text-decoration:none; }

/* Shell so fixed footer doesn't cover content */
.app-shell{
  min-height:100vh;
  padding-bottom: var(--footer-h);
}

/* Page spacing */
.page{ padding: 28px 0; }
.page-title{
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 6px 0;
}
.page-subtitle{
  color: var(--muted);
}

/* Navbar */
header.sticky-top{
  backdrop-filter: saturate(1.2) blur(8px);
}
.navbar{
  background: rgba(255,255,255,0.92) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.navbar .container{ padding-top: 6px; padding-bottom: 6px; }
.navbar-brand{
  font-weight: 800;
  letter-spacing: -0.2px;
}
.navbar .nav-link{
  color: #334155 !important;
  font-weight: 600;
  padding: .55rem .75rem;
  border-radius: 10px;
}
.navbar .nav-link:hover{
  color: var(--text) !important;
  background: #f1f5f9;
}
.dropdown-menu{
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 8px;
}
.dropdown-item{
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
}
.dropdown-item:hover{
  background: #f1f5f9;
}

/* Brand logo */
.brand-logo{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}

/* Cards */
.card-app{
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-app .card-header{
  background: linear-gradient(180deg, rgba(248,250,252,0.9), rgba(255,255,255,0.9));
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}
.card-app .card-body{
  padding: 20px;
}

/* Forms */
.form-label{
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}
.form-control, .form-select{
  border-radius: var(--radius-sm);
  border-color: var(--border);
  padding: 10px 12px;
}
.form-control::placeholder{ color:#94a3b8; }
.form-control:focus, .form-select:focus{
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}

/* Tables */
.table-responsive{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.table{
  margin-bottom: 0;
}
.table thead th{
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}
.table td, .table th{ vertical-align: middle; }
.table tbody tr{ border-color: var(--border); }
.table tbody tr:hover{ background: #f8fafc; }

/* Buttons */
.btn{
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}
.btn-primary{
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 12px 22px rgba(37,99,235,.18);
}
.btn-primary:hover{
  background: var(--primary-600);
  border-color: var(--primary-600);
}
.btn-outline-secondary{
  border-color: #cbd5e1;
}

/* Badges / small text */
.small, small{ color: var(--muted); }

/* Fixed Footer */
.app-footer{
  height: var(--footer-h);
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 1030;
  backdrop-filter: saturate(1.2) blur(8px);
}
.app-footer .inner{
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* RTL polish */
html[dir="rtl"] .navbar .nav-link{ text-align: right; }
html[dir="rtl"] .dropdown-menu{ text-align: right; }


/* Auth pages */
.auth-wrap{
  min-height: calc(100vh - var(--footer-h) - 80px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 28px 12px;
}
.auth-card{
  width:100%;
  max-width: 420px;
}
.auth-title{
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Brand logo */
.brand-logo{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
}

/* Improve default card spacing when someone uses bootstrap .card */
.card > h2{
  margin: 0 0 12px 0;
}


/* KPI cards (Dashboard) */
.kpi-card{
  padding: 18px 18px;
}
.kpi-label{
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}
.kpi-value{
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.3px;
}
.kpi-danger{
  border-color: rgba(239,68,68,.25);
}



/* ---- Customer details enhancements ---- */
.page-head{ margin-bottom: 16px; }
.section-title{ font-weight: 800; font-size: 16px; }
.stat-pill{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  min-width: 220px;
}
.stat-label{ color: var(--muted); font-size: 12px; }
.stat-value{ font-weight: 800; font-size: 20px; line-height: 1.2; }

.kv{ text-align: end; }
.kv .k{ color: var(--muted); font-size: 12px; }
.kv .v{ font-weight: 800; }

.badge-soft-success{ background: rgba(34,197,94,.12); color: #166534; border: 1px solid rgba(34,197,94,.25); }
.badge-soft-danger{  background: rgba(239,68,68,.12); color: #7f1d1d; border: 1px solid rgba(239,68,68,.25); }
.badge-soft-warning{ background: rgba(245,158,11,.14); color: #7c2d12; border: 1px solid rgba(245,158,11,.25); }

/* Better accordion look on cards */
.accordion-item.card-app .accordion-button{
  border-radius: var(--radius);
}
.accordion-item.card-app{
  overflow: hidden;
}
.accordion-button:not(.collapsed){
  background: #f8fafc;
  box-shadow: none;
}

/* RTL tweaks */
[dir="rtl"] .kv{ text-align: start; }
[dir="rtl"] .page-head .btn{ direction: ltr; } /* keep arrow/back button readable */


/* Reminder button (orange) */
.btn-warning{
  background-color:#f59e0b;
  border-color:#f59e0b;
  color:#111827;
}
.btn-warning:hover{
  background-color:#d97706;
  border-color:#d97706;
}
