:root {
    --app-bg: #f5f7fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --surface-subtle: #eef2f7;
    --border-color: #d9e2ec;
    --border-strong: #c7d2e0;
    --text-color: #17212f;
    --text-muted: #5b6b7f;
    --text-soft: #7a8899;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success-soft: #e8f7ef;
    --warning-soft: #fff4dd;
    --danger-soft: #fdeaea;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.10);
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
}

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

body {
    background: var(--app-bg);
    color: var(--text-color);
}

a {
    text-decoration: none;
}

.my-error-class {
    border: 1px solid #dc3545 !important;
    background-color: #fff5f5;
}

.my-error-class:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.15);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
}

.app-navbar {
    background: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.app-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    transition: color 0.2s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .nav-link.active {
    color: #ffffff;
}

.app-navbar .dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.page-section {
    padding: 1rem 0 3rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.page-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    color: var(--text-color);
}

.page-title-sm {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--text-color);
}

.page-subtitle {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
}

.surface-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.surface-card--soft {
    background: var(--surface-muted);
}

.surface-card__body {
    padding: 1.5rem;
}

.surface-card__header,
.surface-card__footer {
    padding: 1.25rem 1.5rem;
    background: var(--surface-muted);
}

.surface-card__header {
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.surface-card__footer {
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.hover-lift {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-grid {
    margin-bottom: 1.5rem;
}

.stat-card {
    height: 100%;
    text-align: center;
}

.stat-card__value {
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1;
    font-weight: 700;
    color: var(--text-color);
}

.stat-card__label {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card--primary .stat-card__value {
    color: #2563eb;
}

.stat-card--success .stat-card__value {
    color: #198754;
}

.stat-card--warning .stat-card__value {
    color: #d97706;
}

.stat-card--teal .stat-card__value {
    color: #0f766e;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.action-row--center {
    justify-content: center;
}

.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.info-banner__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: var(--primary);
    border-radius: 999px;
    font-weight: 700;
}

.info-banner__title {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.info-banner__text {
    margin: 0;
    color: var(--text-muted);
}

.feature-card {
    height: 100%;
    text-align: center;
}

.feature-card__icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: #eaf1ff;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.feature-card__title {
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.feature-card__text {
    margin: 0;
    color: var(--text-muted);
}

.section-stack > * + * {
    margin-top: 1rem;
}

.list-stack {
    display: grid;
    gap: 1rem;
}

.word-card__body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.word-card__main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.word-card__counter {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

.word-card__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.word-card__toggle {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.word-card__toggle:hover {
    color: var(--primary-hover);
}

.word-card__details {
    margin-top: 0.75rem;
    color: var(--text-muted);
}

.word-card__image,
.detail-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.word-card__image {
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
}

.detail-image {
    max-height: 320px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.word-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-soft--success {
    background: var(--success-soft);
    color: #1f7a4f;
}

.badge-soft--secondary {
    background: var(--surface-subtle);
    color: var(--text-muted);
}

.badge-soft--warning {
    background: var(--warning-soft);
    color: #9a6700;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.meta-label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.meta-value {
    color: var(--text-color);
    font-weight: 500;
}

.content-block {
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.content-block__title {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.content-block__text {
    margin: 0;
    color: var(--text-color);
}

.form-panel {
    max-width: 860px;
    margin: 0 auto;
}

.form-card {
    overflow: hidden;
}

.form-card .form-control,
.form-card .form-select,
.form-card textarea,
.form-card input[type="file"] {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}

.form-card .form-control,
.form-card .form-select,
.form-card textarea {
    padding: 0.7rem 0.95rem;
}

.form-card .form-control:focus,
.form-card .form-select:focus,
.form-card textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.form-card .form-label,
.form-card .form-check-label {
    color: var(--text-color);
    font-weight: 600;
}

.form-card .form-text,
.form-card small,
.form-card .text-muted,
.form-card .text-secondary {
    color: var(--text-muted) !important;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-weight: 600;
}

.back-link:hover {
    color: var(--text-color);
}

.image-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.image-preview img {
    width: auto;
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.auth-layout {
    min-height: calc(100vh - 14rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0 2rem;
}

.auth-card {
    width: 100%;
    max-width: 520px;
}

.auth-card__header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-card__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: #eaf1ff;
    color: var(--primary);
    font-weight: 700;
}

.auth-card__title {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
}

.auth-card__subtitle {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
}

.auth-form .form-group,
.auth-form .mb-3 {
    margin-bottom: 1rem;
}

.auth-form label {
    margin-bottom: 0.4rem;
    color: var(--text-color);
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: #fff;
}

.auth-form input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.auth-links {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.auth-links p {
    margin-bottom: 0.5rem;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state__icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eaf1ff;
    color: var(--primary);
}

.empty-state__title {
    margin-bottom: 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.empty-state__text {
    margin: 0;
    color: var(--text-muted);
}

.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border-radius: 0.65rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}

.pagination .page-link:hover {
    background: #eef4ff;
    border-color: #bfd3ff;
    color: var(--primary);
}

.pagination .active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination .disabled .page-link {
    color: #adb5bd;
    background: #fff;
}

.app-footer {
    margin-top: 3rem;
    padding: 1.25rem 0 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.7);
}
.bg-light {
    background-color: #f8f9fa !important;
}


@media (max-width: 991.98px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 767.98px) {
    .page-section {
        padding-top: 0.25rem;
    }

    .surface-card__body,
    .surface-card__header,
    .surface-card__footer {
        padding: 1rem;
    }

    .word-card__body {
        flex-direction: column;
    }

    .word-card__actions {
        width: 100%;
        justify-content: stretch;
    }

    .word-card__actions > * {
        flex: 1 1 100%;
    }

    .word-card__actions .btn {
        width: 100%;
    }

    .meta-grid {
        grid-template-columns: 1fr;
    }

    .auth-layout {
        min-height: auto;
    }
}

  .btn-outline-secondary {
   transition: all 0.2s ease;
  }
  .btn-outline-secondary:hover {
   transform: translateY(-1px);
   background-color: #f0f0f0;
  }
  .collapse .bg-light {
   border-left: 3px solid #0d6efd;
  }
