/* ==========================================================================
   DENTAL SYSTEM — Custom Theme
   Flat, professional medical look. No neon / no glow. Sharp 2px corners.
   ========================================================================== */

:root {
  --primary:        #2f6d8f;   /* muted steel blue  */
  --primary-dark:   #24546f;
  --secondary:      #5b7c99;
  --accent:         #3a7d63;
  --success:        #2f8f5b;
  --info:           #3a7ca5;
  --warning:        #b57b16;
  --danger:         #b63b3b;
  --light:          #f4f6f9;
  --dark:           #1e2a38;
  --body-bg:        #eef1f5;
  --card-border:    #dfe5ec;
  --card-shadow:    0 1px 3px rgba(30, 42, 56, 0.08);
  --sidebar-bg:     #1e2a38;
  --sidebar-text:   #c6d0dd;
  --radius:         2px;
}

/* --- Base ----------------------------------------------------------------- */
body {
  background-color: var(--body-bg);
  color: #24303c;
  font-family: "Karla", "Segoe UI", Roboto, -apple-system, sans-serif;
}

a {
  color: var(--primary);
}
a:hover {
  color: var(--primary-dark);
}

/* --- Left sidebar --------------------------------------------------------- */
.left-sidebar,
.left-sidebar::before {
  background-color: var(--sidebar-bg);
}
.left-sidebar::before {
  background-color: rgba(30, 42, 56, 0.96);
}

.app-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.12);
}
.app-brand .brand-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.4px;
}

.sidebar .sidebar-inner .section-title {
  color: rgba(198, 208, 221, 0.7);
  font-weight: 700;
  letter-spacing: 1.2px;
}

.sidebar .sidebar-inner > li > a {
  color: var(--sidebar-text);
  border-radius: var(--radius);
  margin: 2px 12px;
  padding: 0.7rem 1rem;
  transition: all 0.15s ease;
}
.sidebar .sidebar-inner > li > a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.07);
}
.sidebar .sidebar-inner > li.active > a {
  color: #ffffff;
  background-color: var(--primary);
}
.sidebar .sidebar-inner > li.active > a i {
  color: #ffffff;
}
.sidebar .sub-menu > li > a {
  color: var(--sidebar-text);
  border-radius: var(--radius);
}
.sidebar .sub-menu > li > a:hover,
.sidebar .sub-menu > li.active > a {
  color: #ffffff;
  background-color: rgba(47, 109, 143, 0.35);
}
.sidebar-footer {
  background-color: rgba(0, 0, 0, 0.2);
}

/* --- Navbar --------------------------------------------------------------- */
.main-header .navbar {
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(30, 42, 56, 0.06), 0 1px 4px rgba(30, 42, 56, 0.05);
}
.navbar .page-title {
  color: #1e2a38;
  font-weight: 700;
  font-size: 1.1rem;
}
.breadcrumb-link {
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: none;
  margin-right: 6px;
}
.breadcrumb-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.breadcrumb-sep {
  color: #94a3b8;
  margin-right: 6px;
}
.navbar .sidebar-toggle:before,
.navbar .sidebar-offcanvas-toggle:before {
  color: var(--primary-dark);
}

/* --- Cards ----------------------------------------------------------------- */
.card,
.card-default {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.card-default .card-header {
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-default .card-header h2 {
  color: #1e2a38;
  font-weight: 700;
}
.card-default .card-header h2::before {
  background-color: var(--primary);
}

/* --- Buttons (flat, sharp) ------------------------------------------------ */
.btn {
  border-radius: var(--radius);
}
.btn-pill,
.btn-pill:hover,
.btn-pill:focus {
  border-radius: var(--radius);
}
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-info { background-color: var(--info); border-color: var(--info); }
.btn-success { background-color: var(--success); border-color: var(--success); }
.btn-danger { background-color: var(--danger); border-color: var(--danger); }
.btn-warning { background-color: var(--warning); border-color: var(--warning); color: #fff; }

/* --- Badges ---------------------------------------------------------------- */
.badge { border-radius: var(--radius); }
.badge-primary { background-color: var(--primary); }

/* --- Forms ----------------------------------------------------------------- */
.form-control {
  border-radius: var(--radius);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.18rem rgba(47, 109, 143, 0.2);
}

/* --- Tables (flat fallback) ------------------------------------------------ */
.table thead th {
  color: #334155;
  border-bottom: 2px solid var(--primary);
  background-color: #f8fafc;
}

/* ==========================================================================
   CARD-BASED LISTINGS (replaces plain tables)
   ========================================================================== */
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.list-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 18px;
  position: relative;
}
.list-card .card-title {
  font-weight: 700;
  color: #1e2a38;
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.list-card .card-sub {
  font-size: 0.85rem;
  color: #64748b;
}
.list-card dl {
  margin: 10px 0 0;
}
.list-card dl > div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed #e6ebf1;
  font-size: 0.9rem;
}
.list-card dl > div:last-child {
  border-bottom: none;
}
.list-card dl dt {
  color: #5b6b7a;
  font-weight: 600;
}
.list-card dl dd {
  margin: 0;
  color: #24303c;
  text-align: right;
}
.list-card .card-actions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.list-card .card-actions .btn {
  padding: 4px 10px;
  font-size: 0.8rem;
}
.list-card.card-deleted {
  opacity: 0.55;
  background: #f1f5f9;
}
.list-card.card-deleted .card-title {
  text-decoration: line-through;
}

/* ==========================================================================
   SHARED PRINT DOCUMENT FORMAT (matches the receipts design)
   Used by all report pages for one common, consistent look.
   ========================================================================== */
.print-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.print-doc {
  background: #ffffff;
  border: 1px solid #dfe5ec;
  border-top: 6px solid var(--primary);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--card-shadow);
}
.print-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary);
}
.print-doc-header .clinic-info h2 {
  margin: 0 0 4px;
  color: #1e2a38;
  font-weight: 800;
}
.print-doc-header .clinic-info p {
  margin: 0;
  color: #5b6b7a;
  font-size: 0.85rem;
}
.print-doc-header .doc-title {
  text-align: right;
}
.print-doc-header .doc-title h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
}
.print-doc-header .doc-title p {
  margin: 0;
  color: #5b6b7a;
  font-size: 0.85rem;
}
.print-doc-section {
  margin-bottom: 18px;
}
.print-doc-section h3 {
  margin: 0 0 10px;
  color: #1e2a38;
  font-weight: 700;
  font-size: 1rem;
}
.print-doc-table {
  width: 100%;
  border-collapse: collapse;
}
.print-doc-table th {
  background: #f0f4f8;
  color: #1e2a38;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid #dfe5ec;
  text-align: left;
  font-size: 0.85rem;
}
.print-doc-table td {
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
}
.print-doc-table tr:nth-child(even) td {
  background: #fafbfc;
}
.print-doc-table td.right,
.print-doc-table th.right {
  text-align: right;
}

@page {
  size: A4;
  margin: 12mm;
}

@media print {
  .left-sidebar, .main-header, .sidebar-footer, .print-actions, .no-print { display: none !important; }
  .page-wrapper { margin-left: 0 !important; }
  .content-wrapper { background: #fff; }
  .print-doc {
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
  }
  /* Tables fill the full printable width and never overflow the page */
  .print-doc-table {
    width: 100% !important;
    table-layout: fixed;
    word-break: break-word;
  }
  .print-doc-section { page-break-inside: avoid; }
  .print-doc-section h3 { page-break-after: avoid; }
  /* status / insurance badges print as plain visible text (no borders, no pills) */
  .badge {
    border: none !important;
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-weight: 400 !important;
  }
}

/* ==========================================================================
   AUTH / LOGIN  (single centered & justified container)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #244a5e 0%, #1e2a38 100%);
  margin: 0;
  font-family: "Karla", "Segoe UI", Roboto, sans-serif;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(20, 30, 40, 0.18);
  padding: 2.2rem 2.4rem;
}
.auth-card .auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card .auth-brand img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 0.75rem;
}
.auth-card .auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e2a38;
  margin: 0;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: #5b6b7a;
  margin-bottom: 1.8rem;
  font-size: 0.92rem;
}
.auth-card .form-group label {
  color: #334155;
  font-weight: 600;
  font-size: 0.9rem;
}
.auth-card .form-control {
  height: 46px;
}
.auth-card .btn {
  height: 46px;
  font-weight: 700;
}
.auth-card .auth-foot {
  text-align: center;
  font-size: 0.82rem;
  color: #5b6b7a;
  border-top: 1px solid var(--card-border);
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  line-height: 1.8;
}
