/* =========================================================
   Sigorta Poliçe Takip - Custom Theme
   ========================================================= */

:root {
  --sidebar-width: 250px;
  --sidebar-bg:    #1e293b;
  --sidebar-bg-2:  #0f172a;
  --sidebar-link:  #cbd5e1;
  --sidebar-active:#3b82f6;
  --brand:         #2563eb;
  --brand-dark:    #1d4ed8;
  --soft-bg:       #f4f6fb;
  --card-shadow:   0 2px 12px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--soft-bg);
  color: #1f2937;
}

/* ============== App Layout ============== */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .3s ease;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { padding: 8px 10px 30px; }
.sidebar-nav .nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.45);
  padding: 14px 12px 6px;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-link);
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 14px; }
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(59,130,246,.35);
}

.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-navbar {
  background: #fff;
  padding: .5rem 1rem;
  position: sticky; top: 0; z-index: 1030;
}
.app-navbar .navbar-brand { font-size: 18px; color: #0f172a !important; }
.avatar {
  width: 34px; height: 34px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.app-content { padding: 22px; }
.app-footer  { padding: 14px 22px; border-top: 1px solid #e5e7eb; background: #fff; }

/* ============== Dashboard Cards ============== */
.stat-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  border-left: 4px solid var(--brand);
  cursor: pointer;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.10); }
.stat-card .stat-icon {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 38px;
  opacity: .15;
}
.stat-card .stat-label { color:#64748b; font-size:13px; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.2; margin-top:4px; }
.stat-card.danger  { border-left-color:#ef4444; }
.stat-card.warning { border-left-color:#f59e0b; }
.stat-card.success { border-left-color:#10b981; }
.stat-card.info    { border-left-color:#0ea5e9; }
.stat-card.purple  { border-left-color:#8b5cf6; }
.stat-card.dark    { border-left-color:#0f172a; }
.stat-card.danger  .stat-icon { color:#ef4444; }
.stat-card.warning .stat-icon { color:#f59e0b; }
.stat-card.success .stat-icon { color:#10b981; }
.stat-card.info    .stat-icon { color:#0ea5e9; }
.stat-card.purple  .stat-icon { color:#8b5cf6; }
.stat-card.dark    .stat-icon { color:#0f172a; }

/* ============== Cards & Tables ============== */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  font-weight: 600;
  border-top-left-radius: 12px !important;
  border-top-right-radius: 12px !important;
}
.table { vertical-align: middle; }
.table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 1px solid #e5e7eb;
}
.table-hover tbody tr:hover { background: #f8fbff; }

.badge.rounded-pill { padding: .42em .8em; font-weight: 500; }

/* ============== Buttons ============== */
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
}

/* ============== Login Page ============== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-wrap { width: 100%; max-width: 900px; }
.login-card {
  display: flex;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}
.login-side {
  flex: 1;
  background: linear-gradient(160deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #fff;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-features { list-style: none; padding: 0; margin: 30px 0 0; }
.login-features li { padding: 8px 0; opacity: .9; }
.login-form { flex: 1; padding: 50px 40px; }
@media (max-width: 768px) {
  .login-card { flex-direction: column; }
  .login-side { padding: 30px; text-align: center; }
}

/* ============== Sidebar Mobile ============== */
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 1039;
    display: none;
  }
  .sidebar-backdrop.show { display: block; }
}

/* ============== Misc ============== */
.copy-btn { cursor: pointer; color: #64748b; }
.copy-btn:hover { color: var(--brand); }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.days-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.days-pill.green  { background: #dcfce7; color: #166534; }
.days-pill.blue   { background: #dbeafe; color: #1e40af; }
.days-pill.yellow { background: #fef3c7; color: #92400e; }
.days-pill.orange { background: #ffedd5; color: #9a3412; }
.days-pill.red    { background: #fee2e2; color: #991b1b; }
.days-pill.dark   { background: #1f2937; color: #fff; }

.dt-buttons .btn { margin-right: 4px; }
.dataTables_filter input { border-radius: 6px; }

.modal-content { border: none; border-radius: 14px; }
.modal-header { background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%); color:#fff; border-bottom:none; border-top-left-radius: 14px; border-top-right-radius: 14px; }
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

.form-label { font-size: 13px; font-weight: 600; color: #374151; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(37,99,235,.15);
}

/* DataTables Bootstrap5 fixes */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after { opacity: .25; }
