html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

  @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300&display=swap');


  :root {
    --cream:        #f5f0e8;
    --parchment:    #ede5d0;
    --parchment-dk: #d6c9a8;
    --ink:          #1c1710;
    --ink-light:    #4a3f2f;
    --ink-muted:    #7a6e5e;
    --wood:         #3d2b1f;
    --wood-light:   #6b4c35;
    --gold:         #b8860b;
    --gold-light:   #d4a537;
    --red-book:     #7a1e1e;
    --red-book-lt:  #a33030;
    --green-book:   #1e4a2e;
    --border:       #c8b99a;
    --shadow-sm:    0 2px 8px rgba(28,23,16,.10);
    --shadow-md:    0 4px 20px rgba(28,23,16,.15);
    --shadow-lg:    0 8px 40px rgba(28,23,16,.20);
    --radius:       4px;
    --radius-lg:    8px;
  }


  *, *::before, *::after { box-sizing: border-box; }

  html {
    height: 100%;
  }

  body {
    min-height: 100%;
    background-color: var(--cream);
    background-image:
            radial-gradient(ellipse at 20% 0%, rgba(180,155,100,.18) 0%, transparent 60%),
            radial-gradient(ellipse at 80% 100%, rgba(61,43,31,.10) 0%, transparent 50%),
            url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
    color: var(--ink);
    position: relative;
  }


  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 27px,
            rgba(180,155,100,.07) 27px,
            rgba(180,155,100,.07) 28px
    );
    z-index: 0;
  }


  h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--wood);
    letter-spacing: -.01em;
  }

  h1 { font-size: 2rem; font-weight: 700; }
  h2 { font-size: 1.5rem; font-weight: 600; }

  a {
    color: var(--wood-light);
    text-decoration: none;
    transition: color .2s;
  }
  a:hover { color: var(--gold); }


  .navbar {
    background-color: var(--wood) !important;
    border-bottom: 3px solid var(--gold) !important;
    box-shadow: var(--shadow-md) !important;
    padding: .9rem 1.2rem;
  }

  .navbar-brand {
    font-family: 'Playfair Display', serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--gold-light) !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: normal;
    text-align: left;
  }
  .navbar-brand::before {
    content: '📚 ';
    font-size: 1.1rem;
  }
  .navbar-brand:hover { color: #fff !important; }

  .nav-link {
    color: var(--parchment) !important;
    font-family: 'Source Serif 4', serif;
    font-size: .93rem;
    letter-spacing: .03em;
    padding: .4rem .9rem !important;
    border-radius: var(--radius);
    transition: background .2s, color .2s;
  }
  .nav-link:hover,
  .nav-link.active {
    color: var(--gold-light) !important;
    background: rgba(255,255,255,.08) !important;
  }

  .navbar-toggler {
    border-color: var(--gold) !important;
  }
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28212,165,55,1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  }


  .container {
    max-width: 1100px;
    position: relative;
    z-index: 1;
  }


  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--parchment-dk);
    position: relative;
  }

  .page-header::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
  }

  .page-header h1 {
    margin: 0 0 .25rem;
    line-height: 1.2;
  }


  .card {
    background: #fffdf7;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .25s;
  }
  .card:hover { box-shadow: var(--shadow-md); }

  .card-header {
    background: var(--parchment);
    border-bottom: 1px solid var(--border);
    font-family: 'Playfair Display', serif;
    font-size: .95rem;
    padding: .85rem 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }

  .card.border-danger {
    border-color: #c0392b !important;
    border-width: 2px !important;
  }


  .table {
    font-size: .9rem;
    color: var(--ink);
    margin: 0;
  }

  .table thead th {
    background: var(--parchment);
    color: var(--wood);
    font-family: 'Playfair Display', serif;
    font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid var(--border);
    padding: .75rem 1rem;
    white-space: nowrap;
  }

  .table tbody td {
    padding: .7rem 1rem;
    border-bottom: 1px solid rgba(200,185,154,.4);
    vertical-align: middle;
  }

  .table-hover tbody tr {
    transition: background .15s;
  }
  .table-hover tbody tr:hover {
    background-color: rgba(232,220,195,.35) !important;
  }

  .table-light { background: var(--parchment) !important; }

  .fw-medium { font-weight: 600; }

  .badge-active,
  .badge-inactive {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .75rem;
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
  }
  .label{
    font-size:24px;
  }

  .badge-active {
    background: rgba(30,74,46,.12);
    color: var(--green-book);
    border: 1px solid rgba(30,74,46,.25);
  }
  .badge-active::before { content: '✓ '; }

  .badge-inactive {
    background: rgba(122,30,30,.10);
    color: var(--red-book);
    border: 1px solid rgba(122,30,30,.22);
  }
  .badge-inactive::before { content: '◉ '; }


  .form-label {
    font-family: 'Playfair Display', serif;
    font-size: .875rem;
    font-weight: 600;
    color: var(--ink-light);
    margin-bottom: .35rem;
    letter-spacing: .01em;
  }

  .form-control,
  .form-select {
    background-color: #fffef9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: 'Source Serif 4', serif;
    font-size: .92rem;
    padding: .5rem .85rem;
    transition: border-color .2s, box-shadow .2s;
  }
 

  .form-control:focus,
  .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,134,11,.15);
    background-color: #fff;
    outline: none;
  }

  .form-control::placeholder { color: var(--ink-muted); opacity: .6; }

  .form-check-input {
    border-color: var(--border);
    background-color: #fffef9;
  }
  .form-check-input:checked {
    background-color: var(--green-book);
    border-color: var(--green-book);
  }
  .form-check-label {
    font-size: .92rem;
    color: var(--ink-light);
  }

  .btn {
    font-family: 'Source Serif 4', serif;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .03em;
    border-radius: var(--radius);
    padding: .45rem 1.1rem;
    transition: all .2s;
    border-width: 1.5px;
  }

  .btn-primary {
    background-color: var(--wood) !important;
    border-color: var(--wood) !important;
    color: var(--gold-light) !important;
  }
  .btn-primary:hover {
    background-color: var(--wood-light) !important;
    border-color: var(--wood-light) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }

  .btn-danger {
    background-color: var(--red-book) !important;
    border-color: var(--red-book) !important;
    color: #fff !important;
  }
  .btn-danger:hover {
    background-color: var(--red-book-lt) !important;
    border-color: var(--red-book-lt) !important;
    transform: translateY(-1px);
  }

  .btn-outline-secondary {
    border-color: var(--border) !important;
    color: var(--ink-light) !important;
    background: transparent !important;
  }
  .btn-outline-secondary:hover {
    background-color: var(--parchment) !important;
    border-color: var(--parchment-dk) !important;
    color: var(--ink) !important;
  }

  .btn-outline-danger {
    border-color: rgba(122,30,30,.4) !important;
    color: var(--red-book) !important;
    background: transparent !important;
  }
  .btn-outline-danger:hover {
    background-color: var(--red-book) !important;
    color: #fff !important;
  }


  .btn-action {
    font-size: .78rem !important;
    padding: .25rem .7rem !important;
  }


  .alert-danger {
    background: rgba(122,30,30,.08);
    border: 1px solid rgba(122,30,30,.25);
    color: var(--red-book);
    border-radius: var(--radius);
    font-size: .9rem;
  }

  dl.row dt {
    font-family: 'Playfair Display', serif;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-muted);
    font-weight: 600;
    padding-top: .4rem;
  }
  dl.row dd {
    font-size: .95rem;
    padding-top: .35rem;
    color: var(--ink);
    border-bottom: 1px dashed var(--parchment-dk);
    padding-bottom: .3rem;
  }

  .text-center.py-5 {
    background: var(--parchment);
    border-radius: var(--radius-lg);
    font-style: italic;
    color: var(--ink-muted);
  }


  .footer {
    width: 100%;
    line-height: 60px;
    background-color: var(--wood);
    border-top: 2px solid var(--gold) !important;
    color: var(--parchment) !important;
    font-size: .82rem;
    letter-spacing: .04em;
    white-space: nowrap;
    z-index: 1;
  }

  .footer a {
    color: var(--gold-light);
    margin-left: .5rem;
  }
  .footer a:hover { color: #fff; }


  .text-muted, .text-muted.mb-0, .text-muted.small {
    color: var(--ink-muted);
    font-style: italic;
  }
  .text-danger.small { font-size: .8rem; }


  .card-body.p-4::before {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--parchment-dk));
    border-radius: 2px;
    margin-bottom: 1.25rem;
  }


  .border-top { border-top-color: var(--border) }
  .border-bottom { border-bottom-color: var(--border)  }


  .card,
  .page-header,
  table {
    animation: fadeUp .35s ease both;
  }
  .card { animation-delay: .05s; }
  table { animation-delay: .1s; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }


  @media (max-width: 576px) {
    .page-header { flex-direction: column; }
    h1 { font-size: 1.5rem; }
    .btn { width: 100%; justify-content: center; }
  }
