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

/* Caution flag: red text when Yes on add/view subject */
.caution-flag-section.caution-flag-yes,
.caution-flag-section.caution-flag-yes p,
.caution-flag-section.caution-flag-yes label,
.caution-flag-section.caution-flag-yes span:not([style*="color:"]) {
    color: #b91c1c !important;
}
.caution-flag-section.caution-flag-yes .section-label,
.caution-flag-section.caution-flag-yes strong {
    color: #b91c1c !important;
}

/* List rows for subjects with caution flag = Yes */
tr.caution-flag-row {
    background-color: #fecaca !important;  /* darker pink highlight */
}
tr.caution-flag-row:hover {
    background-color: #fca5a5 !important;
}

/* Caution icon in list views – bright and easy to see */
td.list-caution-icon {
    color: #dc2626 !important;
    font-size: 1.35em;
    font-weight: bold;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f5f5;
    color: #0f172a;
    padding-top: 60px;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 48px;
    max-width: 1100px;
    width: 100%;
    background: #ffffff;
    padding: 40px 56px;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.login-badge {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-badge img {
    max-width: 320px;
    height: auto;
}

.login-card {
    max-width: 360px;
    width: 100%;
    margin-left: auto;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.login-card p {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6b7280;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.field-label {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1f2937;
}

.text-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 24px;
    color: #0f172a;
}

.text-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

/* Display-only / read-only: no box around text (view subject, added subject/location) */
.text-input[disabled],
.textarea[disabled] {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 8px 0;
    cursor: default;
    -webkit-appearance: none;
    appearance: none;
}

.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.error-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 22px;
}

.status-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 22px;
}

.main-menu-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 16px 32px;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
}

.main-menu-title {
    margin: 0 0 24px;
    padding: 12px 28px;
    border-radius: 8px;
    border: 2px solid #0f172a;
    background: #0f172a;
    color: #f9fafb;
    text-align: center;
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.main-menu-logo {
    margin: 0 0 28px;
    flex-shrink: 0;
    display: block;
}

.main-menu-logo img {
    max-width: 440px;
    width: 100%;
    height: auto;
    display: block;
}

.main-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 140px);
    justify-content: center;
    gap: 28px;
    margin-bottom: 32px;
}

.main-menu-tile {
    background: #2563eb;
    border-radius: 20px;
    padding: 18px 12px 14px;
    text-align: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.45);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-menu-symbol {
    font-size: 34px;
    line-height: 1;
    margin-bottom: 6px;
}

.main-menu-symbol.plus {
    font-size: 80px;
}

.main-menu-footer {
    order: 4;
    margin-top: 8px;
    font-size: 11px;
    color: #6b7280;
}

.logout-button {
    order: 3;
    margin-top: 8px;
}

.search-form-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 16px;
    background-color: #ffffff;
}

.page-title {
    margin-top: 16px;
    margin-bottom: 24px;
    font-size: 30px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #0f172a;
}

/* Tables and list data – larger, darker text across view subject, incidents, recent, search */
table td,
table th {
    font-size: 24px;
    color: #0f172a;
    padding: 12px 14px;
}

table th {
    color: #1f2937;
    font-weight: 600;
}

.search-form {
    width: 100%;
    max-width: 760px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.search-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.btn-search {
    max-width: 220px;
    margin: 0 auto;
}

.add-subject-shell {
    min-height: 100vh;
    padding: 32px;
    background: #f3f4f6;
}

.add-subject-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.add-subject-title {
    font-size: 36px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0f172a;
}

.case-number {
    font-size: 22px;
    color: #1f2937;
}

.case-number span {
    color: #ef4444;
    font-weight: 600;
}

.add-subject-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr);
    gap: 24px;
}

.add-subject-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 20px 24px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    font-size: 24px;
    color: #0f172a;
}

.add-subject-card .ques-list,
.add-subject-card .ques-item {
    font-size: 22px;
    color: #0f172a;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.field-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.textarea {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    resize: vertical;
    font-size: 24px;
    color: #0f172a;
}

.section-label {
    font-size: 22px;
    margin-bottom: 6px;
    color: #1f2937;
}

.section-label.positive {
    color: #15803d;
    font-size: 26px;
}

.section-label.negative {
    color: #b91c1c;
    font-size: 26px;
}

.photo-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.photo-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: #f9fafb;
    color: #9ca3af;
    font-size: 13px;
}

.checkbox-row {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 22px;
    color: #0f172a;
}

.admin-link {
    font-size: 12px;
    margin-top: 8px;
}

.sheepdog-logo {
    position: fixed;
    right: 16px;
    bottom: 12px;
    width: 72px;
    height: auto;
    z-index: 100;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #0f172a;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.4);
    z-index: 200;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-nav-brand {
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 12px;
    color: #e5e7eb;
    text-decoration: none;
}

.top-nav-user {
    font-size: 12px;
    color: #9ca3af;
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-nav-links a {
    font-size: 13px;
    color: #e5e7eb;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
}

.top-nav-links a:hover {
    background: rgba(148, 163, 184, 0.2);
}

.top-nav-logout {
    margin: 0;
}

.top-nav-logout button {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: transparent;
    color: #e5e7eb;
    font-size: 12px;
    cursor: pointer;
}

.top-nav-logout button:hover {
    background: rgba(248, 250, 252, 0.08);
}

.ques-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.btn-secondary {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: #e5e7eb;
    color: #111827;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.ques-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ques-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 12px;
}

.ques-remove {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
    background: #f3f4f6;
}

.search-web-link {
    color: #2563eb;
    font-size: 12px;
}

.search-web-link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .login-layout {
        grid-template-columns: 1fr;
        padding: 32px 24px;
    }

    .login-badge {
        display: flex;
        justify-content: center;
        padding-bottom: 16px;
    }

    .login-badge img {
        max-width: 220px;
    }

    .login-card {
        margin-left: auto;
        margin-right: auto;
    }

    .main-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 120px));
    }

    .add-subject-layout {
        grid-template-columns: 1fr;
    }

    .add-subject-shell {
        padding: 24px 16px;
    }

    .search-form-shell {
        padding: 24px 16px;
    }

    .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }

    .main-menu-title {
        font-size: 18px;
        padding: 8px 18px;
        margin-bottom: 20px;
    }

    .text-input,
    .textarea,
    .add-subject-card,
    .section-label {
        font-size: 22px;
    }

    .add-subject-card .ques-list,
    .add-subject-card .ques-item {
        font-size: 20px;
    }

    table td,
    table th {
        font-size: 22px;
    }

    .page-title {
        font-size: 24px;
    }

    .add-subject-title {
        font-size: 28px;
    }

    .main-menu-logo {
        margin: 0 0 24px;
    }

    .main-menu-logo img {
        max-width: 280px;
    }

    .main-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 130px));
        gap: 18px;
    }

    .page-shell {
        padding: 24px 12px;
    }

    .search-form {
        max-width: 100%;
    }

    .search-grid-2 {
        grid-template-columns: 1fr;
    }

    .add-subject-shell {
        padding: 20px 12px;
    }

    .field-row-2 {
        grid-template-columns: 1fr;
    }

    .checkbox-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-nav {
        padding: 0 12px;
    }

    .top-nav-links {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .login-layout {
        padding: 24px 16px;
    }

    .login-badge img {
        max-width: 180px;
    }

    .main-menu-logo {
        margin: 0 0 20px;
    }

    .main-menu-logo img {
        max-width: 240px;
    }

    .main-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 110px));
    }

    .main-menu-tile {
        min-height: 100px;
        padding: 14px 10px;
        font-size: 12px;
    }

    .main-menu-symbol.plus {
        font-size: 56px;
    }

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

    .text-input,
    .textarea {
        font-size: 20px;
    }

    .add-subject-card,
    .section-label {
        font-size: 20px;
    }

    .add-subject-card .ques-list,
    .add-subject-card .ques-item {
        font-size: 18px;
    }

    table td,
    table th {
        font-size: 20px;
    }

    .page-title {
        font-size: 20px;
    }

    .add-subject-title {
        font-size: 24px;
    }

    .top-nav {
        height: auto;
        padding: 8px 10px;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .top-nav-left {
        width: 100%;
        justify-content: space-between;
    }

    .top-nav-links {
        width: 100%;
        justify-content: flex-start;
    }
}

