/* --- 1. Variables & Global Defaults --- */
:root {
    --primary-blue: #003366;
    --accent-teal: #008080;
    --light-gray: #f4f4f9;
    --text-dark: #333333;
    --white: #ffffff;
    --error-red: #d9534f;
    --pico-primary: #008080;
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --secondary-blue: #007bff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    margin: 0;
    padding: 0;
}

/* --- 2. Layout & Containers --- */
.container {
    margin-right: auto;
    margin-left: auto;
    padding: 0 20px;
    width: 100%;
    transition: max-width 0.3s ease;
}

/* Responsive Container Scaling */
@media (min-width: 1024px) { .container { max-width: 95% !important; } }
@media (min-width: 1600px) { .container { max-width: 1800px !important; } }

/* Focused Container for Forms/Login */
.container-narrow {
    max-width: 1400px !important;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow form {
    max-width: none;
    width: 100%;
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.container-narrow h5 {
    text-align: left;
    margin-top: 2rem;
}

/* --- 3. Header & Navigation --- */
header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem 0;
    border-bottom: var(--accent-teal) 3px solid;
}

header.dashboard-header {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.logo-img {
    height: auto;
    max-height: 180px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1); /* Makes logo white */
}

.header-headings {
    flex: 1;
    text-align: center;
}

.header-headings h1 {
    font-size: 2rem;
    margin: 0;
    color: var(--white);
}

header ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
}

header li { padding: 0 10px; }
header a { color: var(--white); text-decoration: none; }

/* --- 4. Tables --- */
table {
    width: 100%;
    overflow: visible !important;
}

.table-profile th,
.table-profile td,
.container-narrow table td,
.container-narrow table th {
    text-align: left !important;
    vertical-align: top;
    border-bottom: 1px solid #eee;
    padding: 12px 8px;
}

.table-profile th {
    width: 35%;
    color: var(--primary-blue);
    font-weight: 600;
}

/* Mobile Table Scrolling */
@media (max-width: 1023px) {
    figure { overflow-x: auto; margin-inline: 0; }
    table[role="grid"] {
        display: table;
        min-width: 700px;
    }
    table[role="grid"] th, table[role="grid"] td { white-space: nowrap; }
}

/* --- 5. Buttons & Actions --- */
button, [role="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    width: auto;
    margin-bottom: 0;
    text-decoration: none;
    transition: background 0.2s;
}

/* Force buttons in a group or specific layouts to behave */
.button-group {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-danger {
    background-color: var(--error-red) !important;
    border-color: var(--error-red) !important;
    color: white !important;
}

.btn-danger:hover {
    background-color: #c9302c !important;
}

.btn-teal {
  --pico-background-color: #008080; /* Teal */
  --pico-border-color: #008080;
  --pico-color: #fff;
}

/* Secondary Button Small Variation */
a[role="button"].secondary {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  display: inline-block;
  width: auto;
  background-color: var(--secondary-blue);
  color: rgb(255, 255, 255);
  text-decoration: none;
  border: 1px solid var(--secondary-blue);
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
}

/* --- 6. Dashboards & Master-Detail --- */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.admin-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
}

.admin-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-teal);
}

.master-detail-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1023px) {
    .master-detail-container { grid-template-columns: 1fr; }
}

/* --- 7. Images & Profile UI --- */
.img-id-style {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    display: block;
    margin: 0 auto;
}

.photo-review-header {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
}

.profile-photo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.photo-card {
        width: 100%;
        max-width: 400px; /* Limits the photo card so it doesn't span the whole screen */
}

/* --- 8. Form Grids --- */
.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.grid-form .full-width { grid-column: span 2; }

.grid-form label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-blue);
    margin-bottom: 0.3rem;
}

/* --- 9. Misc Utilities --- */
.specialty-tag { display: inline-block; margin: 0 5px 5px 0; }

dialog#doc-modal { width: 90%; max-width: 800px; }

.evidence-cell { display: flex; flex-direction: column; gap: 5px; }

.file-row { display: flex; align-items: center; gap: 10px; }

.change-password-btn {
    display: flex; /* or keep inline-flex but ensure it's the only thing on the line */
    margin-left: auto;
    margin-right: 0;
    width: auto;
    padding: 0.5rem 1.5rem;
}