/* =========================
   GLOBAL RESET
========================= */
*{box-sizing:border-box;margin:0;padding:0;font-family:Segoe UI,Arial}

/* =========================
   BODY / BACKGROUND
========================= */
/* PANEL SAYFALARI */
body{
  min-height:100vh;
  background:linear-gradient(135deg,#070b12,#0f1724,#000000);
  padding:18px;
  padding-top:82px;
}

/* =========================
   AUTH CARD (LOGIN/RESET/ADD_USER)
   - Varsayılan .card login ekranı içindir
========================= */
.card{
  width:100%;
  max-width:520px;
  background:rgba(15,20,35,.92);
  backdrop-filter:blur(10px);
  border-radius:16px;
  padding:30px 22px;
  box-shadow:0 0 12px rgba(255,0,0,.35);
  border:2px solid rgba(255,59,59,.75);
  text-align:center;
}

/* PANEL SAYFALARINDA (page-wrap içindeyse) kart geniş olsun */
.page-wrap .card{
  max-width:1100px;
  text-align:left;
  padding:18px 18px;
  border:2px solid rgba(255,59,59,.75);
  box-shadow:0 0 10px rgba(255,0,0,.28);
}

/* =========================
   TYPO / BASIC
========================= */
.logo{ width:110px; margin-bottom:10px; }
h2{ color:#fff; margin-bottom:20px; letter-spacing:.3px; }

/* =========================
   INPUTS
========================= */
input, select, textarea{
  width:100%;
  padding:13px;
  border-radius:10px;
  outline:none;
  background:#0b1220;
  color:#fff;
  border:2px solid rgba(255,59,59,.55);
  margin-top:10px;
  box-shadow:0 0 6px rgba(255,0,0,.25);
}
input:focus, select:focus, textarea:focus{
  border:2px solid #ff2a2a;
  box-shadow:0 0 12px rgba(255,0,0,.6);
}

/* =========================
   BUTTONS (GENERIC)
   - Login ekranı için default geniş
========================= */
button, a.btn{
  width:100%;
  padding:13px;
  margin-top:15px;
  border:none;
  border-radius:10px;
  background:linear-gradient(90deg,#ff0000,#ff2a2a,#ff0000);
  color:white;
  font-weight:bold;
  cursor:pointer;
  display:inline-block;
  text-decoration:none;
  text-align:center;
}
a.btn{
  background:#0b1220;
  border:1px solid #1e293b;
}

/* PANELDE (page-wrap içindeyse) buton geniş olmasın */
.page-wrap button,
.page-wrap a.btn{
  width:auto;
  margin-top:0;
}

/* =========================
   MESSAGES
========================= */
.msg{
  margin-top:15px;
  font-weight:600;
  color:#ffffff;
}
.msg.ok{ color:#7CFF9A; }

.error{
  margin-top:14px;
  color:#ffffff;
  font-weight:600;
}

/* =========================
   GRID (add_user)
========================= */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:14px;
}
@media(max-width:520px){
  .grid{ grid-template-columns: 1fr; }
}

/* =========================
   TOP BAR (header.php)
========================= */
.topbar{
  position:fixed;
  top:0; left:0; right:0;
  height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
  background:rgba(15,20,35,.92);
  border-bottom:1px solid rgba(255,0,0,.18);
  backdrop-filter:blur(10px);
  z-index:9999;
}
.brand{display:flex;align-items:center;gap:10px}
.brand-logo{width:38px;height:auto}
.brand-text{color:#fff;font-weight:700;letter-spacing:.3px}
.nav{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.nav a{
  color:#fff;
  text-decoration:none;
  padding:9px 10px;
  border-radius:10px;
  border:1px solid rgba(30,41,59,.9);
  background:#0b1220;
  font-size:13px;
}
.nav a:hover{border-color:#ff2a2a}
.nav a.danger{border-color:rgba(255,0,0,.35)}

/* =========================
   PAGE WRAP (content pages)
========================= */
.page-wrap{
  width:100%;
  max-width:1100px;
  margin:0 auto;
}

/* SUBNAV - tek satır, ekranın tamamını kullanır */
.card-nav{
  position:relative;
  left:50%;
  transform:translateX(-50%);

  width:max-content;
  max-width:calc(100vw - 24px);

  margin:18px 0 22px 0;
  padding:0;

  display:flex;
  align-items:center;
  justify-content:center;

  gap:6px;
  flex-wrap:nowrap;

  overflow:hidden; /* scroll yok */
  z-index:5;
}

.card-nav a{
  flex:0 0 auto;
  color:#fff;
  text-decoration:none;

  font-size:11px;
  padding:7px 9px;

  border-radius:10px;
  background:linear-gradient(180deg,#1a2438,#0b1220);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 0 12px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.05);

  white-space:nowrap;
  transition:.2s;
}

/* Butonları otomatik küçült (tek satıra sığsın) */
.card-nav a{
  color:#fff;
  text-decoration:none;

  padding: clamp(6px, 0.7vw, 10px) clamp(8px, 1vw, 16px);
  font-size: clamp(11px, 0.85vw, 14px);

  border-radius:10px;
  background:linear-gradient(180deg,#1a2438,#0b1220);
  box-shadow:0 0 12px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  transition:.2s;

  white-space:nowrap;
  min-width: 0;                /* max-content KAPAT */
}

.card-nav a:hover{
  background:#ff2a2a;
  border-color:#ff2a2a;
}

.card-nav a.active{
  background:linear-gradient(180deg,#ff3b3b,#b30000);
  border-color:#ff3b3b;
  box-shadow:0 0 14px rgba(255,0,0,.45);
}
/* =========================
   TOOLBAR (Collections/Payments)
========================= */
.toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:10px 0 14px 0;
}
.toolbar form{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.toolbar label{
  color:#b8c0cf;
  font-weight:800;
  font-size:13px;
}
.toolbar input[type="month"]{
  width:160px;
  height:36px;
  padding:4px 8px;
  font-size:13px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:#0b1220;
  color:#fff;
  margin-top:0;
}
.toolbar .btn{
  width:auto !important;
  height:36px;
  padding:0 14px;
  font-size:13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  border-radius:12px;
  margin-top:0;
  background:linear-gradient(180deg,#1a2438,#0b1220);
  border:1px solid rgba(255,255,255,.10);
}
.toolbar .btn:hover{border-color:#ff3b3b;}
.toolbar .btn.red{border-color:rgba(255,59,59,.55);}
.toolbar a.btn{ text-decoration:none; }

/* =========================
   TABLE + ACTIONS (Payments)
========================= */
.table{width:100%;border-collapse:separate;border-spacing:0 10px;}
.table th{color:#9aa4b2;font-size:13px;text-align:left;padding:0 10px; font-weight:800;}
.table td{padding:12px 10px;color:#fff;font-size:13px;vertical-align:middle;}
.row{background:#0b1220;border:1px solid rgba(255,255,255,.06);}
.amount{font-weight:900;}
.small{color:#b8c0cf;font-size:12px;}

.page-wrap, .page-wrap *{ color:#fff; }
.page-wrap .small, .page-wrap th, .page-wrap label{ color:#b8c0cf; }

/* Compact buttons inside tables */
.btn.small{
  padding:6px 10px !important;
  font-size:12px !important;
  border-radius:10px !important;
  min-width:auto !important;
  height:30px !important;
  line-height:18px !important;
  background:linear-gradient(180deg,#1a2438,#0b1220) !important;
  border:1px solid rgba(255,255,255,.10) !important;
}
.btn.small.red{
  border-color:rgba(255,59,59,.55) !important;
}
.btn.small:hover{ border-color:#ff3b3b !important; }

/* Actions (3 nokta) butonu ortalı dursun */
.actions-cell{
  text-align:right;
}
.actions-wrap{
  position:relative;
  display:inline-flex;
  justify-content:flex-end;
  align-items:center;
}
.act-btn{
  height:30px;
  width:44px;
  border-radius:10px;
  background:#0b1220;
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}
.act-btn:hover{ border-color:#ff3b3b; }

.act-menu{
  display:none;
  position:absolute;
  right:0;
  top:36px;
  min-width:150px;
  background:#0b1220;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  z-index:99;
  overflow:hidden;
}
.act-menu a{
  display:block;
  padding:10px 12px;
  text-decoration:none;
  color:#fff;
  font-weight:800;
  font-size:13px;
}
.act-menu a:hover{ background:rgba(255,59,59,.18); }
.act-menu a.danger:hover{ background:rgba(255,0,0,.22); }
.actions-wrap.open .act-menu{ display:block; }
/* sadece login ekranı ortalı */
.login-page{
  display:flex;
  align-items:center;
  justify-content:center;
}
@media (max-width:768px){

.card-nav{
    flex-wrap:wrap;
    justify-content:flex-start;
    gap:6px;
}

.card-nav a{
    font-size:12px;
    padding:6px 9px;
}

}