/* ============================================================
   Hizmet Takip – Global Stylesheet
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-w: 260px;
  --bg-dark: #f1f5f9;
  /* Açık arka plan */
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --accent: #4f7ef8;
  --accent2: #7c3aed;
  --border: rgba(0, 0, 0, .08);
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Sidebar Karartma Değişkenleri */
  --sb-bg: #111827;
  --sb-text: #f3f4f6;
  --sb-text-muted: #9ca3af;
  --sb-border: rgba(255, 255, 255, .1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  margin: 0;
  font-size: .92rem;
}

/* ── Auth ─────────────────────────────────────── */
.auth-body {
  background: radial-gradient(ellipse at 30% 60%, #1e2a6e 0%, #0f1117 70%);
  color: #fff;
}

.auth-card {
  background: #1a1d27;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(10px);
}

.auth-card .form-label,
.auth-card .text-muted {
  color: #9ca3af !important;
}

/* ── Layout ───────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Dark) */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  color: var(--sb-text);
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--sb-border);
  color: var(--sb-text);
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}

.sidebar-section {
  padding: 1rem .75rem .25rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sb-text-muted);
  font-weight: 600;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  border-radius: .6rem;
  color: var(--sb-text-muted);
  text-decoration: none;
  transition: all .15s;
  margin: .1rem .5rem;
  font-size: .88rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.sidebar-nav a.active {
  font-weight: 600;
  background: rgba(79, 126, 248, .15);
  color: var(--accent);
}

.sidebar-nav a i {
  width: 18px;
  text-align: center;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--sb-border);
}

/* Main content (Light) */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar .page-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.page-body {
  padding: 1.75rem;
}

/* ── Cards / Widgets ──────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
}

.card-body {
  padding: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-icon.primary {
  background: rgba(79, 126, 248, .1);
  color: var(--accent);
}

.stat-icon.success {
  background: rgba(16, 185, 129, .1);
  color: var(--success);
}

.stat-icon.danger {
  background: rgba(239, 68, 68, .1);
  color: var(--danger);
}

.stat-icon.warning {
  background: rgba(245, 158, 11, .1);
  color: var(--warning);
}

.stat-icon.purple {
  background: rgba(124, 58, 237, .1);
  color: #a78bfa;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ── Tables ───────────────────────────────────── */
.table {
  color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(0, 0, 0, .01);
  --bs-table-hover-bg: rgba(79, 126, 248, .04);
  --bs-table-border-color: var(--border);
}

.table thead th {
  color: var(--text-muted);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  padding: 12px 8px;
}

/* ── Forms ────────────────────────────────────── */
.form-control,
.form-select {
  background: #fff;
  border: 1px solid #d1d5db;
  color: var(--text);
  border-radius: .6rem;
}

.form-control:focus,
.form-select:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 126, 248, .1);
  color: var(--text);
}

.form-control::placeholder {
  color: #9ca3af;
}

.form-select option {
  background: #fff;
  color: var(--text);
}

.input-group-text {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  color: var(--text-muted);
}

.form-label {
  font-size: .85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: .35rem;
}

/* ── Buttons ──────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: .6rem;
  font-weight: 600;
  transition: opacity .2s, transform .15s;
  color: #fff;
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm {
  border-radius: .4rem;
  font-size: .78rem;
}

/* ── Badges ───────────────────────────────────── */
.badge {
  font-size: .72rem;
  font-weight: 500;
  padding: .4em .6em;
}

/* ── Alert ────────────────────────────────────── */
.alert {
  border-radius: .75rem;
  border: none;
  font-size: .88rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
}

.alert-info {
  background: #e0e7ff;
  color: #3730a3;
}

/* ── Renew countdown ──────────────────────────── */
.days-critical {
  color: var(--danger);
  font-weight: 700;
}

.days-warning {
  color: var(--warning);
  font-weight: 600;
}

.days-ok {
  color: #059669;
}

/* ── Nav pills (auth) ─────────────────────────── */
.nav-pills .nav-link {
  color: var(--text-muted);
  border-radius: .6rem;
  transition: all .2s;
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .1);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .1);
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }
}