/* ============================================================
   BASE.CSS
   ------------------------------------------------------------
   Shared application geometry and structure.

   This file should NOT contain theme-specific:
     - colors
     - backgrounds
     - shadows
     - visual borders (border-color / border-style)
     - typography colors

   It MAY contain shared, non-color typography (font-family,
   font-size, font-weight, letter-spacing) when both themes
   agree on the same value — that keeps the rule in one place
   instead of pasted into every theme file.

   Load order:

       <link rel="stylesheet" href="base.css">
       <link rel="stylesheet" href="theme-1.css">

   or:

       <link rel="stylesheet" href="base.css">
       <link rel="stylesheet" href="theme-2.css">
   ============================================================ */


/* ============================================================
   GLOBAL GEOMETRY
   ============================================================ */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
	font-size:small;
}

#page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}


/* ============================================================
   HEADER STRUCTURE
   ============================================================ */

#pagetop {
    position: sticky;
    top: 0;
    z-index: 20;
}

#topnav {
    /* NOTE: this was previously `position: fixed`, which fights
       with #pagetop's `position: sticky` above it — a fixed
       child is taken out of flow, so the sticky wrapper collapses
       to zero height. Both theme files were silently overriding
       this back to `relative` to make sticky actually work.
       Fixed at the source instead of relying on a theme override. */
    position: relative;

    display: flex;
    align-items: center;

    padding: 16px 20px;
}


/* Header zones */

#topnav .nav-left,
#topnav .nav-center,
#topnav .nav-right {
    display: flex;
    align-items: center;
}

#topnav .nav-center {
    flex: 1;
    justify-content: center;
    gap: 8px;
	position: static; 
}

#topnav .nav-right {
    margin-left: auto;
    gap: 24px;
}


/* ============================================================
   HEADER / NAVIGATION LIST GEOMETRY
   ============================================================ */

#topnav ul {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    gap: 1rem;
}

.nav-center ul,
.nav-right ul {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    gap: 6px;
}

.nav-center li,
.nav-right li {
    display: flex;
}

.nav-center li::marker,
.nav-right li::marker {
    content: none;
}


/* Menu wrapper */

.menu-wrapper {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}


/* Site navigation items */

#sitenavitem {
    display: flex;
    gap: 12px;
}

#sitenavitem .navi-link a {
    display: inline-block;
    padding: 0 2px;
}


/* ============================================================
   LOGO
   ============================================================ */

#sitelogo {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
}

#sitelogo li {
    display: flex;
    align-items: center;
}

#sitelogo img.site-logo {
    width: 120px;
    height: auto;

    display: block;

    object-fit: contain;
    object-position: center;

    transition: filter 0.15s ease;
}


/* ============================================================
   USER STATUS
   ============================================================ */

#siteuserstatus {
    display: flex;
    align-items: center;
}

#siteuserstatus img {
    width: 22px;
    height: 22px;
    transition: none;
}


/* ============================================================
   MENU TOGGLE
   ============================================================ */

.menu-toggle {
    cursor: pointer;
    font-weight: 600;
    padding: 6px 12px;
}


/* ============================================================
   DROPDOWN
   ============================================================ */

.menu-backdrop {
    position: fixed;
    inset: 0;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.18s ease;

    z-index: 15;
}

.menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.menu-dropdown {
    position: absolute;

    top: calc(100% + 1px);
    left: 2px;

    width: 260px;

    opacity: 0;
    pointer-events: none;

    transform: translateY(-6px);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;

    z-index: 25;
}

.menu-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


/* Dropdown sections */

.menu-section {
    padding: 8px 0;
}

.menu-section:last-child {
    border-bottom: none;
}

.menu-service {
    padding: 8px 16px;
    font-weight: 600;
}

.menu-dropdown .menu-page {
    display: block;
    padding: 6px 32px;
    text-decoration: none;
    font-size: 14px;
}


/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */

#maincontent-wrapper {
    flex: 1;

    display: flex;
    flex-direction: column;

    min-width: 0;
    width: 100%;

    padding: 12px 24px;

    box-sizing: border-box;
}

#maincontent {
    width: 93vw;
    margin: 0 auto;

    display: table;
}

#maincontent > * {
    margin-bottom: 20px;
}


/* ============================================================
   SERVICE / PAGE HEADINGS
   ============================================================ */

.service-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: x-large;
}

.servicepop {
}

.no-data-text {
    width: 94%;
    padding: 10px;

    display: table;

    font-size: large;
    margin: 1.5em auto;
}


/* ============================================================
   FOOTER
   ============================================================ */

#pagebottom {
    width: 100%;

    height: 30px;
    min-height: 30px;
    max-height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============================================================
   LINKS
   ============================================================ */

a {
    text-decoration: none;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

/* Visible keyboard focus (WCAG 2.4.7). Themes may restyle the
   ring color via --focus-ring, but every theme must keep some
   visible indicator here. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.menu-toggle:focus-visible,
.badge-count:focus-visible {
    outline: 2px solid var(--focus-ring-color, #0078d4);
    outline-offset: 2px;
}


/* ============================================================
   FLEX GROUPS / CARDS
   ============================================================ */

.flex-group-card,
.flex-group-grid {
    display: flex;
    flex-wrap: wrap;

    gap: 1.25rem;

    margin-bottom: 1em;
}

.flex-grid-card {
    flex: 1 1 300px;
    min-width: 250px;

    display: flex;
}


/* Small card */

.card-sm {
    display: flex;
    flex-direction: column;

    flex: 1 1 260px;
    min-width: 210px;

    padding: 5px 10px 10px 10px;

    box-sizing: border-box;
}


/* ============================================================
   UI FORMAT HEADING
   ============================================================ */

.ui-format-heading {
    margin: 1.5rem 0 0.5rem;

    font-size: 1.4rem;
    font-weight: 600;
}


/* ============================================================
   ZONES
   ============================================================ */

.zone {
    width: 100%;
	padding:10px;
    display: block;
}

.zone-border {
    border-radius: 5px;
}

.zone-shadow {
}

.zone-margin-bottom {
    margin-bottom: 1em;
}


/* Zone heading */

.zoneheading {
    width: 98%;
    margin: 0.15em auto 0 0.15em;

    display: flex;
    align-items: center;
    justify-content: space-between;

    font-weight: bold;
}

.zoneheadleft {
    flex: 1;

    letter-spacing: -0.050em;
    font-weight: 700;
    font-size: 24px;
}

.zoneheadmiddle {
    flex: 1;
    text-align: center;
}

.zoneheadright {
    flex: 1;
    text-align: right;
}


/* Add button */

.add-btn {
    display: inline-block;

    padding: 2px 8px;

    font-size: 15px;
    font-weight: bold;

    text-decoration: none;

    cursor: pointer;
}


/* Zone content */

.zonecontentinner {
    width: 98%;

    margin: 0 auto;

    display: table;
}

.zonecontent {
    width: 100%;

    padding: 5px;
    margin: auto;

    display: table;
}


/* Zone messages */

.zonemessage {
    float: left;

    margin: 0;
    padding: 2px 0 0 0;

    font-weight: 500;
    font-size: 0.9rem;
}

.zoneacid {
    width: 100%;
    display: table;
}

.nodata-title {
    letter-spacing: -0.050em;

    font-size: 20px;

    margin-bottom: 3px;
}

.nodata-message {
    padding: 2px 0 0 0;

    font-weight: 500;
}


/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;

    margin: 0.5em 0 0 0.5em;
    padding: 0;

    border: none;

    font-size: smaller;
    letter-spacing: 0.02em;
}

.crumb {
    text-decoration: none;
    font-weight: 500;
}

.crumb-current {
    font-weight: 600;
    cursor: default;
}


/* ============================================================
   ACTION BAR / SEARCH
   ============================================================ */

.actionbar {
    display: flex;
    align-items: center;

    gap: 0.6rem;
    justify-content: flex-start;

    flex-wrap: wrap;
}


/* Action links */

.add-link,
.exit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 2px 6px;

    font-size: 12px;
    font-weight: 600;

    height: 21px;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    transition: background-color 0.15s ease-in-out;
}


/* Search wrapper */

.grid-search-box {
    display: flex;
    align-items: center;

    position: relative;

    width: 115px;

    font-size: 0.85em;
    margin: 0;
    padding: 0;
}


/* Search input */

.grid-search-box input[type="text"] {
    flex: 1;

    width: 100%;

    padding: 3px 20px 3px 20px;

    font-size: 12px;

    outline: none;
    box-sizing: border-box;

    height: 22px;
    line-height: 1.2;
}


/* Search icon */

.grid-search-box .bi-search {
    position: absolute;

    left: 6px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 10px;

    pointer-events: none;
}


/* Search clear button */

.grid-search-clear {
    position: absolute;

    right: 6px;
    top: 50%;

    transform: translateY(-50%);

    font-size: 10px;

    display: flex;
    align-items: center;

    text-decoration: none;
}


/* ============================================================
   TABLES
   ============================================================ */

.table-wrapper {
    max-width: 94vw;
    margin: auto;
}

.wrapper {
    margin: auto;

    overflow-y: auto;

    max-height: 460px;
}

.table-wrapper-info {
    width: 100%;

    display: table;

    margin: 0.2em 0 0.3em 0;
}

table {
    width: 100%;

    border-collapse: separate;

    white-space: nowrap;
}

table thead {
    position: sticky;
    top: 0;

    z-index: 1;

    font-weight: bolder;
}


/* Table cells */

td {
    padding: 2px;
}

.col-center {
    text-align: center;
}

.table-first-column {
    padding-left: 0;
}


/* Table action column */

.table-action-column {
    width: 65px;
}

.table-action-column i {
    font-size: 12px;
}

.table-action-column a.tbl-action {
    padding: 0;
    margin: 0 2px 0 0;

    display: inline-flex;
    align-items: center;
}

.tbl-action {
    padding: 2px 2px 2px 1px;
}

.no-records-found {
    padding: 0 8px;
}

.thead th {
    padding-right: 8px;
}


/* Table striping */

.table-striped > tbody > tr:nth-child(odd) > td {
    transition: background-color 0.3s ease;
}

table tbody tr:hover td {
    opacity: 1;
}


/* Acid rows */

.acidrow {
    display: none;
}


/* ============================================================
   BADGE / COUNT
   ============================================================ */

.badge-count {
    display: inline-block;

    padding: 1px 6px;

    min-width: 18px;
    height: 18px;
    line-height: 16px;

    border-radius: 2px;

    text-align: center;

    font-size: 0.75em;

    cursor: pointer;

    transition: all 0.15s ease-in-out;
}

.badge-count.disabled {
    cursor: default;
}


/* ============================================================
   PAGINATION
   ============================================================ */

.table-footer {
    display: flex;
}

.table-footer .pagination .pagination-sm {
    margin-bottom: 0;
}

.pagination {
    margin-bottom: 0;
}

.pagination a {
    float: left;

    margin-top: 0.5em;

    text-decoration: none;

    transition: background-color 0.3s;
}

.page-link:focus {
    box-shadow: none;
}

.table-footer .pagination-sm .page-link {
    padding: 2px 6px;

    font-size: 0.75rem;

    min-width: 0;
}

.table-footer .pagination-sm .page-item {
    margin-right: 2px;
}

.table-footer .pagination-sm .page-item:last-child {
    margin-right: 0;
}

.table-footer .grid-ps {
    font-size: 0.70rem;

    padding: 1px 0;

    height: auto;
    min-width: 1vw;
}

.grid-ps {
    margin-right: 0.5em;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding-right: 4px;

    display: inline-block !important;
    vertical-align: middle;

    width: auto !important;
}


/* Page count */

.pagecount {
    text-align: end;

    flex: 1;

    font-size: smaller;
    font-weight: 550;

    margin-top: 8px;
    padding-right: 10px;
}


/* ============================================================
   DETAIL CARD
   ============================================================ */

.detail {
    width: 100%;

    padding: 20px 32px 20px 20px;

    box-sizing: border-box;

    margin-bottom: 1em;

    border-radius: 4px;
}


/* Detail title */

.detailcard-title {
    flex-basis: 100%;

    font-size: 20px;
    font-weight: 600;

    padding-left: 8px;
}


/* Detail body */

.detailcard-body {
    display: flex;
    flex-wrap: wrap;

    gap: 24px;

    align-items: flex-start;
}


/* Detail section */

.detailcard-section {
    display: inline-flex;
    flex-direction: column;

    min-width: 250px;
}

.detailcard-label {
    font-weight: 600;
}

.detailcard-value {
    margin-top: 2px;
    line-height: 1.5;
}


/* ============================================================
   FORM GEOMETRY
   ============================================================ */

.form-fields-container {
    display: flex;
    flex-direction: column;

    gap: 14px;
}

.form-fields-row {
    display: flex;

    gap: 20px;
}

.form-field {
    flex: 1;

    display: flex;
    flex-direction: column;
}

.form-button {
    width: 100%;

    display: flex;
    justify-content: flex-end;

    padding: 15px 0;
}


/* ============================================================
   RESPONSIVE LAYOUT
   ============================================================ */

@media (max-width: 640px) {

    /* Header */

    #topnav {
        flex-direction: column;
        align-items: stretch;

        gap: 4px;

        padding: 8px 16px;
    }

    .nav-center {
        width: 100%;

        justify-content: flex-start;

        margin-top: 2px;
    }

    .menu-wrapper {
        flex-direction: column;
        gap: 1px;
    }

    .nav-right {
        width: 100%;

        justify-content: flex-start;

        gap: 4px;

        margin-top: 2px;
    }

    #sitenavitem {
        gap: 6px;
    }

    #siteuserstatus {
        flex-direction: row;

        gap: 6px;
    }

    .navi-link a {
        padding: 1px 0;

        font-size: 15px;
    }


    /* Main content */

    #maincontent-wrapper {
        padding: 16px 12px;
    }

    #maincontent > * {
        margin-bottom: 16px;
    }


    /* Headings */

    .service-heading {
        gap: 4px;
        font-size: large;
    }


    /* No-data message */

    .no-data-text {
        width: 94%;

        padding: 10px;

        margin: 1.5em auto;
    }

	.zone {
		padding:2px;
	}


    /* Tables */

    .table-wrapper {
        max-width: 90vw;
    }


    /* Forms */

    .form-fields-row {
        flex-direction: column;
    }

    .form-field {
        width: 100%;
    }
}