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;
}
/* ============================================================
   Global layout
   ============================================================ */

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

body > .container {
  flex: 1 0 auto;
}

main {
  padding-bottom: 2rem;
}

.footer {
  position: static !important;
  flex-shrink: 0;
  width: 100%;
  line-height: normal !important;
}

/* ============================================================
   Dictionaries
   ============================================================ */

.dictionary-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dictionary-table {
  min-width: 980px;
}

.dictionary-row {
  display: grid;
  grid-template-columns:
    minmax(140px, 0.9fr)
    minmax(220px, 1.3fr)
    minmax(300px, 2fr)
    120px
    90px
    170px;
  gap: 0;
  align-items: center;
  min-width: 980px;
  border-bottom: 1px solid var(--bs-border-color);
}

.dictionary-cell {
  padding: 0.5rem;
}

.dictionary-table thead th:nth-child(1) {
  min-width: 140px;
}

.dictionary-table thead th:nth-child(2) {
  min-width: 220px;
}

.dictionary-table thead th:nth-child(3) {
  min-width: 300px;
}

.dictionary-table thead th:nth-child(4) {
  min-width: 120px;
}

.dictionary-table thead th:nth-child(5) {
  min-width: 90px;
}

.dictionary-table thead th:nth-child(6) {
  min-width: 170px;
}

/* ============================================================
   Tutte le Corde — Design System v1
   ============================================================ */

:root {
  --tutte-burgundy: #a90f18;
  --tutte-burgundy-dark: #850b12;
  --tutte-burgundy-soft: #f8e9ea;

  --tutte-blue: #1266d6;
  --tutte-blue-dark: #0c53b4;

  --tutte-danger: #dc2633;
  --tutte-danger-dark: #b71925;

  --tutte-text: #202a3b;
  --tutte-text-soft: #647084;
  --tutte-border: #e1e6ed;

  --tutte-bg: #f7f8fa;
  --tutte-card: rgba(255, 255, 255, 0.96);

  --tutte-shadow:
    0 8px 30px rgba(24, 35, 55, 0.08);

  --tutte-radius: 12px;
}


/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */

html,
body {
  min-height: 100%;
}

body.tutte-body {
  margin: 0;
  min-height: 100vh;
  color: var(--tutte-text);
  background: var(--tutte-bg);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.tutte-shell {
  min-height: 100vh;
  display: flex;
}


/* ------------------------------------------------------------
   Sidebar
   ------------------------------------------------------------ */

.tutte-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;

  width: 250px;
  min-height: 100vh;

  display: flex;
  flex-direction: column;

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.99),
      rgba(250,250,250,0.98)
    );

  border-right: 1px solid var(--tutte-border);
}

.tutte-brand {
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--tutte-border);
}

.tutte-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.tutte-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.tutte-brand-text {
  min-width: 0;
}

.tutte-brand-text strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  line-height: 1.15;
  color: #111;
}

.tutte-brand-text span {
  display: block;
  margin-top: 3px;

  color: var(--tutte-text-soft);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutte-nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tutte-nav-item {
  min-height: 45px;
  padding: 10px 13px;

  display: flex;
  align-items: center;
  gap: 12px;

  border-radius: 9px;

  color: #344054;
  text-decoration: none;
  font-weight: 500;

  transition:
    background-color .15s ease,
    color .15s ease,
    transform .15s ease;
}

.tutte-nav-item:hover {
  color: var(--tutte-burgundy);
  background: var(--tutte-burgundy-soft);
}

.tutte-nav-icon {
  width: 22px;
  text-align: center;
  font-size: 1.15rem;
}

.tutte-sidebar-footer {
  margin-top: auto;
  padding: 20px 24px 28px;
}

.tutte-sidebar-quote {
  padding-top: 16px;
  border-top: 1px solid var(--tutte-border);

  color: #758094;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-style: italic;
}


/* ------------------------------------------------------------
   Main
   ------------------------------------------------------------ */

.tutte-main {
  width: 100%;
  min-width: 0;
  min-height: 100vh;

  margin-left: 250px;

  display: flex;
  flex-direction: column;
}


/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */

.tutte-topbar {
  min-height: 72px;
  padding: 10px 28px;

  display: flex;
  align-items: center;

  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--tutte-border);

  position: sticky;
  top: 0;
  z-index: 1020;

  backdrop-filter: blur(12px);
}

.tutte-topbar-spacer {
  flex: 1;
}

.tutte-account {
  display: flex;
  align-items: center;
}

.tutte-topbar-mobile-brand {
  display: none;
}

.tutte-mobile-logo {
  width: 43px;
  height: 43px;
  object-fit: contain;
}

.tutte-mobile-menu-button {
  border: 0;
  background: transparent;

  font-size: 1.35rem;
  color: var(--tutte-text);

  padding: 6px;
}


/* ------------------------------------------------------------
   Decorative app background
   ------------------------------------------------------------ */

.tutte-page-background {
  position: relative;
  min-height: calc(100vh - 72px);

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 85% 0%,
      rgba(169, 15, 24, 0.035),
      transparent 32%
    ),
    linear-gradient(
      180deg,
      #fafbfc 0%,
      #f7f8fa 100%
    );
}

.tutte-page-background::before {
  content: "";

  position: absolute;
  z-index: 0;

  top: -70px;
  right: -100px;

  width: 720px;
  height: 260px;

  opacity: 0.06;

  transform: rotate(-5deg);

  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 20px,
      #1d2430 21px,
      transparent 22px
    );

  pointer-events: none;
}

.tutte-page-background::after {
  content: "";

  position: absolute;
  z-index: 0;

  left: 0;
  right: 0;
  bottom: 0;

  height: 200px;

  opacity: 0.055;

  background:
    radial-gradient(
      ellipse at 10% 100%,
      #20252d 0 16%,
      transparent 17%
    ),
    radial-gradient(
      ellipse at 23% 105%,
      #20252d 0 19%,
      transparent 20%
    ),
    radial-gradient(
      ellipse at 38% 104%,
      #20252d 0 17%,
      transparent 18%
    ),
    radial-gradient(
      ellipse at 54% 104%,
      #20252d 0 20%,
      transparent 21%
    ),
    radial-gradient(
      ellipse at 70% 105%,
      #20252d 0 18%,
      transparent 19%
    ),
    radial-gradient(
      ellipse at 86% 105%,
      #20252d 0 21%,
      transparent 22%
    );

  pointer-events: none;
}


/* ------------------------------------------------------------
   Content
   ------------------------------------------------------------ */

.tutte-content {
  position: relative;
  z-index: 2;

  width: min(1500px, 100%);
  margin: 0 auto;

  padding: 32px 34px 70px;

  flex: 1 0 auto;
}

.tutte-footer {
  position: relative;
  z-index: 2;

  padding: 18px 34px;

  border-top: 1px solid rgba(210, 216, 225, 0.7);

  color: #8892a2;
  font-size: 0.85rem;
}


/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

.tutte-content h1,
.tutte-content h2,
.tutte-content h3 {
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  color: #15191f;
}

.tutte-content h1 {
  font-size: clamp(2rem, 3vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}


/* ------------------------------------------------------------
   Cards
   ------------------------------------------------------------ */

.tutte-card,
.card {
  border: 1px solid var(--tutte-border);
  border-radius: var(--tutte-radius);

  background: var(--tutte-card);

  box-shadow:
    0 2px 10px rgba(30, 40, 60, 0.035);
}

.tutte-section-card {
  padding: 22px;
  margin-bottom: 20px;

  border: 1px solid var(--tutte-border);
  border-radius: var(--tutte-radius);

  background: rgba(255,255,255,0.96);

  box-shadow:
    0 2px 12px rgba(24, 35, 55, 0.045);
}

.tutte-section-title {
  margin-bottom: 16px;

  display: flex;
  align-items: center;
  gap: 9px;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-weight: 700;
}


/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.form-control,
.form-select {
  min-height: 42px;

  border-color: #d7dde6;
  border-radius: 8px;

  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tutte-burgundy);

  box-shadow:
    0 0 0 0.18rem rgba(169, 15, 24, 0.11);
}


/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  border-radius: 8px;
  font-weight: 600;
}

.btn-primary {
  background: var(--tutte-blue);
  border-color: var(--tutte-blue);
}

.btn-primary:hover {
  background: var(--tutte-blue-dark);
  border-color: var(--tutte-blue-dark);
}

.btn-danger {
  background: var(--tutte-danger);
  border-color: var(--tutte-danger);
}

.btn-danger:hover {
  background: var(--tutte-danger-dark);
  border-color: var(--tutte-danger-dark);
}

.tutte-btn-brand {
  color: #fff;
  background: var(--tutte-burgundy);
  border-color: var(--tutte-burgundy);
}

.tutte-btn-brand:hover {
  color: #fff;
  background: var(--tutte-burgundy-dark);
  border-color: var(--tutte-burgundy-dark);
}


/* ------------------------------------------------------------
   Tables
   ------------------------------------------------------------ */

.table-responsive {
  border-radius: var(--tutte-radius);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  padding-top: 12px;
  padding-bottom: 12px;

  background: #f3f5f8;

  color: #465267;
  font-size: 0.82rem;
  font-weight: 700;

  border-bottom-color: var(--tutte-border);
}

.table tbody td {
  padding-top: 12px;
  padding-bottom: 12px;

  vertical-align: middle;

  border-color: #edf0f4;
}

.table-hover tbody tr:hover td {
  background: #fafbfc;
}


/* ------------------------------------------------------------
   Filter panels
   ------------------------------------------------------------ */

.tutte-filter-panel {
  margin-bottom: 22px;
  padding: 16px;

  border: 1px solid var(--tutte-border);
  border-radius: var(--tutte-radius);

  background: rgba(255,255,255,0.94);

  box-shadow:
    0 2px 8px rgba(24,35,55,0.035);
}


/* ------------------------------------------------------------
   Page headers
   ------------------------------------------------------------ */

.tutte-page-header {
  margin-bottom: 24px;

  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.tutte-page-subtitle {
  margin-top: 4px;
  margin-bottom: 0;

  color: var(--tutte-text-soft);
  font-size: 1rem;
}


/* ------------------------------------------------------------
   Action bar
   ------------------------------------------------------------ */

.tutte-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;

  margin-top: 28px;
  margin-left: -10px;
  margin-right: -10px;

  padding: 14px 10px;

  display: flex;
  justify-content: flex-end;
  gap: 10px;

  background:
    linear-gradient(
      180deg,
      rgba(247,248,250,0),
      rgba(247,248,250,0.96) 30%
    );
}


/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 991.98px) {

  .tutte-sidebar {
    transform: translateX(-100%);

    box-shadow:
      16px 0 40px rgba(20,30,50,0.13);

    transition:
      transform .2s ease;
  }

  .tutte-sidebar.tutte-sidebar-open {
    transform: translateX(0);
  }

  .tutte-main {
    margin-left: 0;
  }

  .tutte-topbar {
    min-height: 62px;
    padding: 8px 16px;
  }

  .tutte-topbar-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .tutte-content {
    padding:
      24px 16px
      60px;
  }

  .tutte-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .tutte-page-header .btn {
    width: 100%;
  }

  .tutte-action-bar {
    margin-left: -16px;
    margin-right: -16px;

    padding-left: 16px;
    padding-right: 16px;
  }

  .tutte-page-background::before {
    width: 420px;
    opacity: 0.035;
  }

  .tutte-page-background::after {
    opacity: 0.035;
  }
}

@media (max-width: 575.98px) {

  .tutte-content h1 {
    font-size: 2rem;
  }

  .tutte-action-bar {
    flex-direction: column;
  }

  .tutte-action-bar .btn {
    width: 100%;
  }
}
