/* General page styling */

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;

    color: #333333;

    background-image: url('/static/images/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    min-height: 100vh;
}


/* =========================================================
   Header
   ========================================================= */

.header {
    background: rgba(25, 25, 25, 0.9);

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

    display: flex;
    align-items: center;

    gap: 2rem;
    padding: 1rem 2rem;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}


/* =========================================================
   Logo
   ========================================================= */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;

    flex-shrink: 0;
}

.logo img {
    height: 60px;
    width: auto;
}

.logo span {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}


/* =========================================================
   Main Navigation
   ========================================================= */

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;

    background: transparent;
    padding: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;

    padding: 0.5rem 0.75rem;

    border-radius: 6px;

    transition: background-color 0.2s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}


/* =========================================================
   Header Actions
   ========================================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;

    margin-left: auto;
}


/* =========================================================
   Help Icon
   ========================================================= */

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    color: white;
    text-decoration: none;

    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;

    font-size: 1rem;
    font-weight: bold;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.header-icon:hover {
    background: rgba(255, 255, 255, 0.15);

    border-color: white;

    text-decoration: none;
}


/* =========================================================
   User Menu
   ========================================================= */

.user-menu {
    position: relative;
}


/* User menu button */

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    background: transparent;
    color: white;

    border: none;
    border-radius: 6px;

    padding: 0.4rem 0.6rem;

    cursor: pointer;

    font-size: 1rem;
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* User icon */

.user-icon {
    font-size: 1.2rem;
}


/* Dropdown arrow */

.dropdown-arrow {
    font-size: 0.65rem;
}


/* =========================================================
   User Dropdown
   ========================================================= */

.user-dropdown {
    display: none;

    position: absolute;

    top: calc(100% + 0.5rem);
    right: 0;

    min-width: 160px;

    background: white;

    border-radius: 8px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

    overflow: hidden;

    z-index: 2000;
}


/* Dropdown links */

.user-dropdown a {
    display: block;

    padding: 0.75rem 1rem;

    color: #333333;

    text-decoration: none;

    white-space: nowrap;

    transition: background-color 0.2s ease;
}

.user-dropdown a:hover {
    background: #f3f4f6;

    text-decoration: none;
}


/* Show dropdown */

.user-dropdown.show {
    display: block;
}


/* =========================================================
   Main Content Area
   ========================================================= */

.content {
    max-width: 1200px;
    margin: 2rem auto;

    padding: 2rem;

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

    border-radius: 12px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}


/* =========================================================
   Cards / Containers
   ========================================================= */

.card,
.madigan_container {
    background: white;

    border-radius: 8px;

    padding: 1.5rem;

    margin-bottom: 1.5rem;

    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* =========================================================
   Headings
   ========================================================= */

h1 {
    margin-top: 0;
    color: #161616;
}

h2 {
    color: #0deeee;
}


/* =========================================================
   Tables
   ========================================================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f3f4f6;
}


/* =========================================================
   Forms
   ========================================================= */

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;

    padding: 0.75rem;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
}


/* =========================================================
   Buttons
   ========================================================= */

button {
    background-color: #2563eb;
    color: white;

    border: none;
    border-radius: 6px;

    padding: 0.75rem 1rem;

    cursor: pointer;

    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #1d4ed8;
}


/* =========================================================
   Utility Classes
   ========================================================= */

.text-center {
    text-align: center;
}

.text-black {
    color: #333333;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}


/* =========================================================
   Users / Source Systems Pages
   ========================================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 2rem;
    margin-bottom: 2rem;
}

.page-description {
    margin-top: 0.5rem;
    color: #666666;
}

.page-actions {
    display: flex;
    gap: 0.75rem;

    flex-shrink: 0;
}

/* =========================================================
   User Administration Sections
   ========================================================= */

.admin-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 2rem;

    margin-bottom: 1.5rem;
}


.section-header h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}


.section-actions {
    flex-shrink: 0;
}


/* =========================================================
   Source System List
   ========================================================= */

.source-system-list {
    display: flex;
    flex-direction: column;

    gap: 0.75rem;
}


.source-system-item {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 1rem;

    padding: 1rem 1.25rem;

    background: #f9fafb;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}


.source-system-info {
    display: flex;
    flex-direction: column;

    gap: 0.25rem;
}


.source-system-name {
    font-weight: bold;
    color: #161616;
}


.source-system-description {
    font-size: 0.9rem;
    color: #666666;
}


.source-system-actions {
    flex-shrink: 0;
}

/* =========================================================
   User Search and Filters
   ========================================================= */

.user-filters {
    display: grid;

    grid-template-columns: 2fr 1fr 1fr;

    gap: 1rem;

    margin-bottom: 1.5rem;

    padding: 1rem;

    background: #f9fafb;

    border: 1px solid #e5e7eb;
    border-radius: 8px;
}


.user-filters label {
    margin-bottom: 0.4rem;

    font-size: 0.9rem;
    color: #555555;
}


.search-box,
.filter-box {
    display: flex;
    flex-direction: column;
}


/* =========================================================
   User Actions
   ========================================================= */

.user-actions {
    text-align: center;
}


.edit-user {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    color: #2563eb;

    border-radius: 6px;

    text-decoration: none;

    font-size: 1.1rem;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}


.edit-user:hover {
    background-color: #eff6ff;

    color: #1d4ed8;

    text-decoration: none;
}

/* =========================================================
   Source System Administration
   ========================================================= */

.admin-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 2rem;

    margin-bottom: 1.5rem;
}


.section-actions {
    display: flex;
    gap: 0.75rem;

    flex-shrink: 0;
}


.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}


.admin-table th,
.admin-table td {
    padding: 12px;

    border: 1px solid #ddd;

    text-align: left;
}


.admin-table th {
    background-color: #f3f4f6;
}


.user-access-type {
    width: auto;
    min-width: 130px;

    padding: 0.5rem;
}


.user-actions {
    white-space: nowrap;
}

/* Mobile */

@media (max-width: 768px) {

    .user-filters {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   Buttons Used as Links
   ========================================================= */

/* =========================================================
   Buttons Used as Links
   ========================================================= */

.button-primary,
.button-secondary {
    display: inline-block;

    padding: 0.65rem 1rem;

    border-radius: 6px;

    text-decoration: none;
    font-weight: bold;
    font-size: 14px;

    transition: background-color 0.2s ease;
}

/* Primary button */
.button-primary {
    background-color: #2563eb;
    color: white;
}

.button-primary:hover {
    background-color: #1d4ed8;
    text-decoration: none;
}

/* Secondary button */
.button-secondary {
    background-color: #4b5563;
    color: white;
}

.button-secondary:hover {
    background-color: #374151;
    text-decoration: none;
}

/* Space between landing page buttons */
.landing-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}


/* =========================================================
   Users / Source Systems Tables
   ========================================================= */

.users-section {
    margin-top: 1rem;
}

.table-container {
    overflow-x: auto;
}

.users-section table {
    width: 100%;
    border-collapse: collapse;
}

.users-section th,
.users-section td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.users-section th {
    background-color: #f3f4f6;
}


/* =========================================================
   Status
   ========================================================= */

.status {
    display: inline-block;

    padding: 0.25rem 0.6rem;

    border-radius: 999px;

    font-size: 0.85rem;
    font-weight: bold;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}


/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
    text-align: center;

    padding: 3rem 1rem;

    border: 1px dashed #d1d5db;
    border-radius: 8px;

    background-color: #f9fafb;
}

.empty-state h3 {
    margin-top: 0;
}

/* ========================================================= Reports Dashboard ========================================================= */
.report-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.report-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.report-card h3 {
    margin: 0 0 0.75rem 0;
    color: #555555;
    font-size: 1rem;
}

.report-number {
    margin: 0;
    color: #161616;
    font-size: 2.5rem;
    font-weight: bold;
}

/* ========================================================= Report Generation ========================================================= */
.report-generation {
    border-top: 1px solid #e5e7eb;
    padding-top: 2rem;
}

.report-generation h2 {
    margin-top: 0;
}

.report-generation form {
    max-width: 600px;
}

.report-generation .page-actions {
    margin-top: 1.5rem;
}

/* ========================================================= Reports Mobile ========================================================= */
@media (max-width: 1000px) {
    .report-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .report-overview {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {

    .header {
        flex-wrap: wrap;

        gap: 1rem;

        padding: 1rem;
    }


    .main-nav {
        order: 3;

        width: 100%;

        flex-wrap: wrap;
    }


    .header-actions {
        margin-left: auto;
    }


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


    .page-actions {
        width: 100%;
        flex-direction: column;
    }


    .page-actions .button {
        text-align: center;
    }


    .content {
        margin: 1rem;
        padding: 1rem;
    }
}