/* General Body/Page Styling */
body {
    font-family: Arial, sans-serif;
    background-color: white;
    color: black;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Centering the main dashboard title */
#dashboard-section h1 {
    text-align: center;
    color: black;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Centering the entire dashboard section container */
#dashboard-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* Logout Button Styling */
#logout-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s, box-shadow 0.2s;
}
#logout-btn:hover {
    background-color: #5a6268;
    box-shadow: var(--shadow);
}

/* Refresh Button Styling */
#refresh-btn {
    position: absolute;
    top: 25px;
    left: 25px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s, box-shadow 0.2s;
}
#refresh-btn:hover {
    background-color: #5a6268;
    box-shadow: var(--shadow);
}

/* Admin button — sits directly under the Logout button (admins only) */
#admin-link {
    position: absolute;
    top: 62px;
    right: 25px;
    background-color: #FFA500;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    transition: background-color 0.2s, box-shadow 0.2s;
}
#admin-link:hover {
    background-color: #E09400;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.10);
}

/* Adjusting the grid layout for responsiveness */
.dashboard-grid, .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 0;
    margin-bottom: 20px;
}

/* Styles for individual blocks within the dashboard */
.dashboard-block, .team-block {
    background-color: #555;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

/* Specific styling for Unpaid Rents block to handle two-line display */
#unpaid-rents {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Ensure headings and paragraphs in blocks don't override centering */
.dashboard-block h2,
.dashboard-block p,
.team-block h4,
.team-block p {
    margin: 5px 0;
    color: inherit;
}

/* Styles for the "Download List" buttons within the blocks */
.dashboard-block button {
    background-color: #494E53;
    color: white;
    border: 1px solid #777;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8em;
    margin-top: 5px !important;
    transition: background-color 0.2s;
}

.dashboard-block button:hover {
    background-color: #5a6268;
}

/* Style for report links */
.report-link {
    color: #FFA500;
    text-decoration: none;
    margin-top: 5px;
    font-size: 0.9em;
}
.report-link:hover {
    text-decoration: underline;
}

/* Diagnostic and Team Breakdown section titles */
h3 {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    color: black;
}

/* Specific styling for login section */
#login-section {
    text-align: center;
    padding-top: 50px;
}
#login-section h1 {
    color: black;
}
#login-form {
    max-width: 300px;
    margin: 20px auto;
    padding: 22px;
    background-color: #555;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.10);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#login-form label {
    text-align: left;
    color: white;
}
#login-form input[type="text"],
#login-form input[type="password"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #777;
    background-color: #666;
    color: white;
}
#login-form button {
    padding: 10px 15px;
    background-color: #FFA500;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}
#login-form button:hover {
    background-color: #E09400;
}
#login-error {
    color: #ff4d4d;
    font-weight: bold;
    margin-top: 10px;
}

/* "Admin Panel" link below the login box */
.admin-panel-link {
    margin-top: 18px;
}
.admin-panel-link a {
    color: #FFA500;
    text-decoration: none;
    font-size: 0.95em;
    font-weight: bold;
}
.admin-panel-link a:hover {
    text-decoration: underline;
}

/* Logo Styling */
.login-logo,
.dashboard-logo {
    display: block;
    margin: 10px auto;
    max-width: 150px;
    height: auto;
}

/* Specific styling for the snapshot button */
#snapshot-btn {
    display: block;
    width: fit-content;
    margin: 40px auto 20px auto;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: normal;
    transition: background-color 0.2s;
}
#snapshot-btn:hover {
    background-color: #5a6268;
}

/* --- ▼▼▼ UPDATED STYLES FOR TEAM VACANCY RATES ▼▼▼ --- */

/* Green for vacancy rates between 0% and 5% */
.vacancy-green {
    background-color: #28a745;
    border-color: #28a745;
}

/* Yellow for vacancy rates between 5% and 7% */
.vacancy-yellow {
    background-color: #f0ad4e;
    border-color: #f0ad4e;
}

/* Red for vacancy rates above 7% */
.vacancy-red {
    background-color: #d9534f;
    border-color: #d9534f;
}
.team-download-btn {
    background-color: transparent;
    color: white; /* Changed from orange to white */
    border: none;
    text-decoration: underline;
    cursor: pointer;
    padding: 5px 0;
    font-size: 0.9em;
    font-family: Arial, sans-serif;
}

.team-download-btn:hover {
    color: #ccc; /* Lighter gray on hover */
}

/* =========================================================
   Shared design system (brand tokens, admin UI polish)
   ========================================================= */
:root {
    --brand-orange: #FFA500;
    --brand-orange-hover: #E09400;
    --ink: #1f2937;
    --muted: #6b7280;
    --surface: #ffffff;
    --surface-alt: #f7f8fa;
    --border: #e6e8eb;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 6px 20px rgba(16, 24, 40, 0.10);
    --danger: #dc3545;
    --neutral: #6c757d;
    --neutral-hover: #5a6268;
}

#snapshot-btn { box-shadow: var(--shadow-sm); }
#snapshot-btn:hover { box-shadow: var(--shadow); }

/* Unify the dashboard utility buttons with the softer, rounded look */
#logout-btn,
#refresh-btn,
#snapshot-btn,
#admin-link {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ---- Admin page layout ---- */
.admin-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 20px 64px;
    color: var(--ink);
}

.admin-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.admin-bar h1 {
    margin: 0;
    font-size: 1.55rem;
    color: var(--ink);
}
.admin-bar .spacer { flex: 1; }
.admin-bar .admin-logo {
    height: 40px;
    width: auto;
    margin: 0;
    display: inline-block;
}
.admin-bar a {
    color: var(--brand-orange);
    text-decoration: none;
    font-weight: 600;
}
.admin-bar a:hover { text-decoration: underline; }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    margin-top: 22px;
}
.card h3 {
    margin: 0 0 14px;
    text-align: left;
    color: var(--ink);
    font-size: 1.1rem;
}

/* ---- Tables ---- */
.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
table.users {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
table.users th,
table.users td {
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.users thead th {
    background: var(--surface-alt);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}
table.users tbody tr:last-child td { border-bottom: none; }
table.users tbody tr:hover { background: #fafbfc; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}
.badge.admin   { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.badge.user    { background: rgba(107, 114, 128, 0.16); color: #4b5563; }
.badge.success { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }

/* ---- Buttons (admin) ---- */
.admin-wrap button {
    font: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s, box-shadow 0.15s, color 0.15s, opacity 0.15s;
}
.admin-wrap button:hover { box-shadow: var(--shadow); }
.admin-wrap button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* Primary (orange) */
.btn-primary {
    background: var(--brand-orange);
    color: #fff;
}
.btn-primary:hover { background: var(--brand-orange-hover); }

/* Logout */
#admin-panel #logout-btn {
    position: static;
    background: var(--neutral);
    color: #fff;
}
#admin-panel #logout-btn:hover { background: var(--neutral-hover); }

/* Row action buttons */
.row-actions { white-space: nowrap; }
.row-actions button { margin-right: 6px; }
.row-actions button:last-child { margin-right: 0; }
.row-actions button[data-act="password"],
.row-actions button[data-act="toggle"] {
    background: #fff;
    color: #374151;
    border-color: var(--border);
}
.row-actions button[data-act="password"]:hover,
.row-actions button[data-act="toggle"]:hover {
    background: var(--surface-alt);
}
.row-actions button[data-act="delete"] {
    background: #fff;
    color: var(--danger);
    border-color: rgba(220, 53, 69, 0.4);
}
.row-actions button[data-act="delete"]:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* ---- Forms ---- */
.field {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    max-width: 360px;
}
.field label {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 600;
}
.field input[type="text"],
.field input[type="password"] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: #fff;
    color: var(--ink);
}
.field input[type="text"]:focus,
.field input[type="password"]:focus {
    outline: none;
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.18);
}
.field.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
.field.inline label { margin: 0; }
.add-user-card {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Messages ---- */
.msg {
    margin: 12px 0;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    display: none;
    font-size: 0.9rem;
}
.msg.error   { background: #fdecea; color: #b71c1c; display: block; }
.msg.success { background: #e7f6ec; color: #1b5e20; display: block; }
.muted { color: var(--muted); font-size: 13px; }

/* ---- Admin login (mirror the dashboard login styling) ---- */
#admin-login {
    text-align: center;
    padding-top: 50px;
}
#admin-login h1 { color: black; }
#admin-login-form {
    max-width: 300px;
    margin: 20px auto;
    padding: 22px;
    background-color: #555;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#admin-login-form label {
    text-align: left;
    color: white;
    font-weight: 600;
}
#admin-login-form input[type="text"],
#admin-login-form input[type="password"] {
    padding: 9px;
    border-radius: var(--radius-sm);
    border: 1px solid #777;
    background-color: #666;
    color: white;
}
#admin-login-form button {
    padding: 10px 15px;
    background-color: var(--brand-orange);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.15s, box-shadow 0.15s;
}
#admin-login-form button:hover {
    background-color: var(--brand-orange-hover);
    box-shadow: var(--shadow);
}