﻿/* ==========================================================================
   AEGIS-XLMS — hub ribbon, tables and form grids.
   Matches the hub layout used by AEGIS-XSCMS: a light button bar across the
   top where each hub opens a full-width panel of links.
   ========================================================================== */

.ribbon {
    position: relative;
    z-index: 1030;
    width: 100%;
    background: #fff;
    color: #212934;
    border-bottom: 1px solid #e4e7ec;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}

.ribbon .ribbon-brand {
    padding: .7rem 1.05rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    border-right: 1px solid #e4e7ec;
    white-space: nowrap;
}

.ribbon-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px 6px; }

.ribbon-nav > a,
.ribbon-nav > button {
    color: #244463;
    background: #dbe7f7;
    border: 1px solid #b9d0ef;
    border-radius: 7px;
    margin: 3px;
    padding: .5rem .75rem;
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.ribbon-nav > a:hover,
.ribbon-nav > button:hover { background: #cfe0f5; }

.ribbon-nav > button.open { background: #bcd6f2; border-color: #8fbbe8; }

.ribbon-nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-top: 3px solid var(--navy);
    padding: 14px 22px 18px;
    z-index: 1050;
    box-shadow: 0 14px 28px rgba(30,40,60,.14);
    columns: 230px 4;
    column-gap: 30px;
}

.ribbon-nav .submenu.open { display: block; }

.ribbon-nav .submenu a {
    display: block;
    padding: .28rem .35rem;
    color: #244463;
    text-decoration: none;
    font-size: .92rem;
    break-inside: avoid;
}

.ribbon-nav .submenu a:hover { background: #f1f5fb; border-radius: 5px; }

.ribbon-nav .submenu .sub-header {
    margin-top: .5rem;
    padding: .2rem .35rem;
    font-size: .7rem;
    color: #8a94a3;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
    border-bottom: 1px solid #eef0f3;
    break-inside: avoid;
}

.ribbon-nav .submenu .nav-locked {
    color: #9aa3b0;
    font-style: italic;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------- Dashboard stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; }

.stat-card {
    display: block;
    border-radius: 12px;
    padding: 18px 20px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(20,30,60,.10);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,60,.16); }
.stat-card .label { font-size: 13px; opacity: .85; }
.stat-card .value { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; }
.stat-card .hint { font-size: 12px; opacity: .8; }

.stat-navy  { background: var(--navy); }
.stat-blue  { background: #1E5AA8; }
.stat-green { background: #1f7a4d; }
.stat-grey  { background: #5a6572; }

/* ---------- Hub cards on the dashboard ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

.hub-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.hub-card h3 { margin: 0 0 4px; color: var(--navy); font-size: 18px; }
.hub-card .sub { margin: 0 0 12px; font-size: 13px; }
.hub-card a.hub-link { display: block; padding: .25rem 0; color: #1a5fb4; text-decoration: none; font-size: 14px; }
.hub-card a.hub-link:hover { text-decoration: underline; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.table thead th { background: #f0f4ff; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f7f9fd; }

.auto-table-scroll { width: 100%; overflow-x: auto; }

/* ---------- Form grids ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 18px; }
.grid2 label { display: block; font-size: 12px; font-weight: 700; color: #4a5568; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.grid2 input, .grid2 select, textarea { width: 100%; }

.card.form-wide { max-width: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1440px) { .ribbon-nav .submenu { columns: 230px 3; } }
@media (max-width: 1100px) {
    .ribbon-nav { width: 100%; }
    .ribbon-nav .submenu { position: static; columns: 230px 2; box-shadow: none; }
}
@media (max-width: 768px) { .ribbon-nav .submenu { columns: 1; } }

@media print { .ribbon { display: none !important; } }


/* ---------- Minimal fallbacks for the Aurora widget (it was written against Bootstrap) ---------- */
.btn-sm { padding: .25rem .5rem; font-size: 13px; border-radius: 6px; }
.btn-outline-primary { background: #fff; color: #244463; border: 1px solid #b9d0ef; cursor: pointer; }
.btn-outline-primary:hover { background: #eef4fc; }
.btn-outline-secondary { background: #fff; color: #5a6572; border: 1px solid #d2d7de; cursor: pointer; }
.form-control { width: 100%; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.px-2 { padding-left: .5rem !important; padding-right: .5rem !important; }
.spinner-border { display: inline-block; width: 1rem; height: 1rem; border: 2px solid #b9d0ef; border-right-color: transparent; border-radius: 50%; animation: aegis-spin .75s linear infinite; }
@keyframes aegis-spin { to { transform: rotate(360deg); } }


/* ---------- Buttons inside tables ----------
   .linkbtn is styled for the dark top bar, so it was invisible on a white row.
   Inside a table it becomes a readable text button, and delete reads as delete. */
.table .linkbtn,
.card .linkbtn {
    color: #b3261e;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    padding: 2px 4px;
}
.table .linkbtn:hover,
.card .linkbtn:hover { color: #7f1d1a; background: #fdeceb; border-radius: 5px; }

.table .btn,
.table a.btn {
    font-size: 13px;
    padding: .3rem .6rem;
    margin-left: 6px;
    display: inline-block;
}

/* Right-hand action column: keep everything on one line and hard right. */
.table td.actions,
.table th.actions { text-align: right; white-space: nowrap; }
.table td.actions form { display: inline; margin: 0; }

/* Numbers and short values read better centered. */
.table td.num, .table th.num { text-align: center; }

/* The add-a-row form that sits above these tables. */
.row-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row-form label { display: block; font-size: 12px; font-weight: 700; color: #4a5568; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.row-form input, .row-form select { min-width: 220px; }
.row-form .check { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; font-size: 14px; }
.row-form .check input { min-width: 0; }

/* ---------------------------------------------------------------------------
   Tick-list drop-down (.picklist)

   A field that takes more than one answer. Closed it is one line the size of
   any other input; open it is a scrollable list of checkboxes. Built on
   <details> so it opens and closes with no script, which matters because this
   application ships no picker library and a <select multiple> makes people
   hold Ctrl to choose a second item.
   --------------------------------------------------------------------------- */
.picklist {
    border: 1px solid var(--line, #c9d2dd);
    border-radius: 6px;
    background: #fff;
    margin-top: 4px;
}

.picklist > summary {
    list-style: none;
    cursor: pointer;
    padding: 9px 34px 9px 11px;
    position: relative;
    user-select: none;
    color: var(--navy, #1F3864);
}

.picklist > summary::-webkit-details-marker { display: none; }

/* The chevron, drawn rather than imported, and turned when the list is open. */
.picklist > summary::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--slate, #44546A);
    border-bottom: 2px solid var(--slate, #44546A);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .12s ease;
}

.picklist[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.picklist[open] > summary { border-bottom: 1px solid var(--line, #c9d2dd); }
.picklist > summary:hover { background: var(--ice, #EEF2F7); }
.picklist > summary:focus-visible { outline: 2px solid var(--navy, #1F3864); outline-offset: -2px; }

/* A list of fifty boards is not a list anybody reads, it is a list they scroll past.
   The filter is what turns it back into something usable. */
.picklist-filter {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line, #c9d2dd);
    background: var(--bg, #F7F9FC);
}

.picklist-filter input {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    padding: 7px 9px;
    border: 1px solid var(--line, #c9d2dd);
    border-radius: 4px;
}

.picklist-body {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}

/* Hidden by the filter, not by the author. */
.picklist-item[hidden] { display: none; }

.picklist-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--muted, #5B6775);
}

.picklist-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 12px;
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.picklist-item:hover { background: var(--ice, #EEF2F7); }

.picklist-item input[type="checkbox"] {
    width: auto;
    margin: 2px 0 0;
    flex: 0 0 auto;
}

/* The one-line explanation of what a body governs, under its name. */
.picklist-note {
    display: block;
    font-size: 12px;
    color: var(--slate, #44546A);
    margin-top: 1px;
}
