
:root{
  --bg:#f3f6fb;
  --bg-soft:#f8fbff;
  --card:#ffffff;
  --text:#162033;
  --muted:#6f7d95;
  --line:#e5ebf4;
  --primary:#174ea6;
  --primary-2:#3b82f6;
  --success:#15803d;
  --warning:#b45309;
  --danger:#b91c1c;
  --shadow-soft:0 8px 24px rgba(16,24,40,.06);
  --radius:22px;
  --sidebar-w:290px;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:linear-gradient(180deg,#f7faff 0%,#f1f5fb 100%);
  color:var(--text);
  min-height:100%;
}
body{min-height:100vh;overflow-x:hidden}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}

/* existing header.php uyumu */
.layout{min-height:100vh}
.sidebar{
  position:fixed;
  left:0;top:0;bottom:0;
  width:var(--sidebar-w);
  background:linear-gradient(180deg,#0f172a 0%,#152544 100%);
  color:#fff;
  padding:24px 18px;
  overflow-y:auto;
  z-index:50;
}
.sidebar .brand{
  font-size:24px;
  font-weight:800;
  padding:10px 12px 24px;
  border-bottom:1px solid rgba(255,255,255,.08);
  margin-bottom:18px;
}
.sidebar nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.sidebar nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border-radius:16px;
  color:rgba(255,255,255,.88);
  transition:.2s;
}
.sidebar nav a:hover,
.sidebar nav a.active{
  background:rgba(255,255,255,.08);
  color:#fff;
}
.main,.main-area{
  margin-left:var(--sidebar-w);
  padding:22px;
  min-height:100vh;
  min-width:0;
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:18px 22px;
  border:1px solid rgba(255,255,255,.85);
  border-radius:24px;
  box-shadow:var(--shadow-soft);
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(12px);
  margin-bottom:18px;
}
.role-badge,
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid transparent;
}
.role-badge{
  background:#e8f0ff;
  color:#1849a9;
  border-color:#d6e5ff;
}

.alert{
  padding:14px 16px;
  border-radius:16px;
  margin:0 0 16px;
  border:1px solid;
}
.alert.success{background:#ecfdf3;color:#166534;border-color:#bbf7d0}
.alert.error{background:#fef2f2;color:#991b1b;border-color:#fecaca}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  padding:22px;
  margin-bottom:18px;
  min-width:0;
}
.card-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
  flex-wrap:wrap;
}
.card-header h2,.card-header h3{margin:0;font-size:22px}
.card-sub{color:var(--muted);font-size:14px}

label{display:block;font-weight:700;font-size:14px;margin:0 0 8px}
input,select,textarea{
  width:100%;
  padding:13px 14px;
  border:1px solid #d7dfeb;
  border-radius:14px;
  background:#fff;
  color:var(--text);
  outline:none;
  transition:.2s;
  min-width:0;
}
input:focus,select:focus,textarea:focus{
  border-color:#8eb5ff;
  box-shadow:0 0 0 4px rgba(59,130,246,.12);
}
textarea{resize:vertical;min-height:120px}

button,.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 16px;
  border:none;
  border-radius:14px;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#fff;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(37,99,235,.18);
  transition:.2s;
}
button:hover,.btn:hover{filter:brightness(1.02)}
.btn-light{background:#eef4ff;color:#1849a9;box-shadow:none}
.btn-dark{background:#1e293b;color:#fff}
.btn-danger{background:linear-gradient(135deg,#dc2626,#b91c1c)}
.btn-small{padding:9px 12px;border-radius:12px;font-size:13px}

.actions-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.empty-state{
  padding:18px;
  border:1px dashed #d7dfeb;
  border-radius:16px;
  background:#f8fbff;
  color:var(--muted);
  text-align:center;
}
.table-title{font-weight:800;font-size:18px;line-height:1.2}
.sub-text{display:block;color:var(--muted);font-size:13px;margin-top:4px}

.badge-green{background:#ecfdf3;color:#166534;border-color:#bbf7d0}
.badge-red{background:#fef2f2;color:#991b1b;border-color:#fecaca}
.badge-orange{background:#fff7ed;color:#b45309;border-color:#fed7aa}
.badge-blue{background:#eef4ff;color:#1849a9;border-color:#d6e5ff}
.badge-gray{background:#f3f4f6;color:#475569;border-color:#e5e7eb}

/* customers hero */
.customers-page-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:18px;
  flex-wrap:wrap;
  margin-bottom:18px;
  padding:22px 24px;
  border-radius:28px;
  background:linear-gradient(135deg,#0f172a 0%,#174ea6 100%);
  color:#fff;
  box-shadow:0 22px 48px rgba(23,78,166,.24);
}
.page-kicker{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-weight:800;
  color:rgba(255,255,255,.72);
}
.customers-page-title{
  margin:8px 0 4px;
  font-size:36px;
  line-height:1.05;
}
.customers-page-sub{
  color:rgba(255,255,255,.84);
  font-size:14px;
}
.customers-hero-right{
  display:flex;
  align-items:stretch;
  gap:12px;
  flex-wrap:wrap;
}
.mini-kpi{
  min-width:140px;
  padding:14px 16px;
  border-radius:18px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.14);
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.mini-kpi-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:rgba(255,255,255,.72);
  font-weight:800;
}
.mini-kpi-value{
  font-size:28px;
  font-weight:900;
  margin-top:6px;
}
.mini-kpi-value.small{
  font-size:18px;
  line-height:1.2;
}

/* toolbar */
.customers-card{padding:22px}
.customers-toolbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:14px;
  align-items:end;
}
.customers-search-wrap label{margin-bottom:8px}

/* table desktop */
.customers-table-wrap{
  border:none;
  overflow-x:auto;
  overflow-y:visible;
  background:transparent;
}
.customers-table{
  width:100%;
  min-width:1180px;
  border-collapse:separate;
  border-spacing:0 10px;
  background:transparent;
}
.customers-table thead th{
  position:static;
  background:transparent;
  border:none;
  padding:0 12px 8px;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#5c6b86;
  font-weight:800;
}
.customers-table tbody tr{
  background:#fff;
  box-shadow:var(--shadow-soft);
}
.customers-table tbody td{
  background:#fff;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:16px 12px;
  vertical-align:top;
}
.customers-table tbody td:first-child{
  border-left:1px solid var(--line);
  border-top-left-radius:18px;
  border-bottom-left-radius:18px;
}
.customers-table tbody td:last-child{
  border-right:1px solid var(--line);
  border-top-right-radius:18px;
  border-bottom-right-radius:18px;
}
.customers-table tbody tr.row-warning td{background:#fffaf3}
.customers-table tbody tr.row-danger td{background:#fff5f5}

/* mobile card table */
@media (max-width: 860px){
  .customers-card{padding:16px}
  .customers-toolbar{grid-template-columns:1fr}
  .customers-table{
    min-width:0;
    border-spacing:0;
  }
  .customers-table thead{
    display:none;
  }
  .customers-table,
  .customers-table tbody,
  .customers-table tr,
  .customers-table td{
    display:block;
    width:100%;
  }
  .customers-table tbody tr{
    margin-bottom:14px;
    border:1px solid var(--line);
    border-radius:18px;
    overflow:hidden;
    box-shadow:var(--shadow-soft);
    background:#fff;
  }
  .customers-table tbody td{
    border:none;
    border-bottom:1px solid var(--line);
    border-radius:0 !important;
    padding:12px 14px;
  }
  .customers-table tbody td:last-child{
    border-bottom:none;
  }
  .customers-table tbody td::before{
    content:attr(data-label);
    display:block;
    font-size:12px;
    font-weight:800;
    color:#6f7d95;
    text-transform:uppercase;
    letter-spacing:.06em;
    margin-bottom:6px;
  }
}

/* generic tables */
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:20px;
  background:#fff;
}
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
th,td{
  padding:14px 16px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid var(--line);
}
thead th{
  background:#f8fbff;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#5c6b86;
  font-weight:800;
}
tbody tr:last-child td{border-bottom:none}

/* popup */
.notify-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:1200;
}
.notify-modal.show{display:flex}
.notify-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.55);
}
.notify-modal-dialog{
  position:relative;
  width:min(1100px,94vw);
  height:min(88vh,820px);
  background:#fff;
  border-radius:28px;
  border:1px solid var(--line);
  box-shadow:0 22px 48px rgba(16,24,40,.18);
  overflow:hidden;
  z-index:1;
}
.customer-modal-dialog{
  width:min(1100px,94vw)!important;
  height:min(88vh,820px)!important;
}
.customer-modal-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
  background:#f8fbff;
}
.notify-close-btn{
  position:static!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  padding:0!important;
  border-radius:14px!important;
}
.notify-frame{
  width:100%;
  height:calc(100% - 77px);
  border:none;
  background:#fff;
}

/* payments and dashboard */
.dashboard-hero{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(260px,.8fr);
  gap:18px;
  align-items:stretch;
  margin-bottom:18px;
}
.dashboard-hero-copy{
  background:linear-gradient(135deg,#0f172a 0%,#174ea6 100%);
  color:#fff;
  border-radius:28px;
  padding:28px 30px;
  box-shadow:0 22px 48px rgba(23,78,166,.24);
}
.hero-rate-card{
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  border:1px solid var(--line);
  border-radius:28px;
  padding:24px;
  box-shadow:var(--shadow-soft);
}
.hero-rate-label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  font-weight:800;
}
.hero-rate-value{
  font-size:40px;
  line-height:1;
  font-weight:900;
  margin-top:10px;
}
.hero-rate-sub{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
}
.dashboard-stat-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:18px;
}
.dashboard-stat-card{
  padding:18px;
  border-radius:20px;
  background:linear-gradient(180deg,#fff,#f8fbff);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}
.dashboard-grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin-bottom:18px;
}
.dashboard-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.dashboard-list-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:18px;
  background:linear-gradient(180deg,#fff,#fbfdff);
}

/* customer edit */
.customer-edit-page{max-width:1320px}
.customer-edit-grid{
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  gap:14px 24px;
  align-items:center;
}
.customer-edit-label{
  font-size:19px;
  font-weight:800;
  color:#1f2937;
}
.customer-edit-field.small-field input{max-width:220px}

/* responsive */
@media (max-width: 1280px){
  .dashboard-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 980px){
  .dashboard-hero,
  .dashboard-grid-2{
    grid-template-columns:1fr;
  }
}
@media (max-width: 920px){
  .sidebar{
    left:-100%;
    width:min(290px,84vw);
    transition:left .25s ease;
  }
  .sidebar.open{left:0}
  .main,.main-area{margin-left:0;padding:14px}
  .topbar{padding:14px 16px}
}
@media (max-width: 760px){
  .customers-page-title{font-size:30px}
  .topbar{flex-direction:column;align-items:flex-start}
  .notify-modal{padding:10px}
  .notify-modal-dialog{
    width:100%;
    height:min(92vh,900px);
    border-radius:20px;
  }
  .dashboard-stat-grid{grid-template-columns:1fr}
  .dashboard-list-row{flex-direction:column}
  .customer-edit-grid{grid-template-columns:1fr}
}


/* header.php uyum düzeltmesi */
.app-shell{min-height:100vh}
.main-area{
  margin-left:var(--sidebar-w);
  padding:22px;
  min-height:100vh;
  min-width:0;
}
.topbar-left{display:flex;align-items:center;gap:14px;min-width:0}
.topbar-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.role-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid #d6e5ff;
  background:#e8f0ff;
  color:#1849a9;
}
.brand-wrap{display:flex;align-items:center;gap:14px;padding:8px 10px 22px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:18px}
.brand-mark{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#60a5fa,#2563eb);display:grid;place-items:center;font-size:24px;font-weight:800;box-shadow:0 12px 24px rgba(37,99,235,.32)}
.brand-title{font-size:20px;font-weight:800;letter-spacing:.2px}
.brand-subtitle{font-size:12px;color:rgba(255,255,255,.65)}
.nav-menu{display:flex;flex-direction:column;gap:8px}
.nav-link{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:16px;color:rgba(255,255,255,.85);transition:.2s;background:transparent}
.nav-link:hover,.nav-link.active{background:rgba(255,255,255,.08);color:#fff}
.nav-link.danger:hover{background:rgba(239,68,68,.15);color:#fff}
.menu-btn{display:none;width:44px;height:44px;border-radius:14px;padding:0}
.mobile-overlay{display:none}
@media (max-width:920px){
  .main-area{margin-left:0;padding:14px}
  .sidebar{left:-100%;width:min(290px,84vw);transition:left .25s ease}
  .sidebar.open{left:0}
  .mobile-overlay{position:fixed;inset:0;background:rgba(15,23,42,.45);display:none;z-index:40}
  .mobile-overlay.show{display:block}
  .menu-btn{display:inline-flex}
  body.menu-open{overflow:hidden}
}
