﻿/* ==========================================================================
   Application shell
   ========================================================================== */

.dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--surface);
}

/* -- header -------------------------------------------------------------- */

.header-bar { display: flex; align-items: stretch; background: var(--surface); }

.header-logo-box {
    width: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 4px 8px;
}

.header-logo { width: 72px; height: 62px; object-fit: contain; }

.header-bands { flex: 1; display: flex; flex-direction: column; }

.header-blue {
    position: relative;
    height: 46px;
    background: var(--brand-blue);
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.header-title { font-size: 27px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }

.header-exit-form { margin-left: auto; }

.btn-exit {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 8px;
    background: var(--surface);
    border: 1px solid #b9c6d2;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.btn-exit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    background: var(--brand-red);
    color: #fff;
    font-size: 13px;
}

.btn-exit:hover { background: #fdf3f2; }

.header-green {
    height: 34px;
    background: var(--brand-green);
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.header-tagline { font-size: 17px; color: #fff; }

/* -- tab strip ----------------------------------------------------------- */

.tab-strip {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 30px;
    padding: 0 6px;
    background: var(--surface);
    border-bottom: 1px solid #b9c6d2;
}

.tab-strip-scroller {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-strip-scroller::-webkit-scrollbar { display: none; }

.tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    background: #f2f5f8;
    border: 1px solid #b9c6d2;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 12px;
    color: var(--ink-muted);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.tab-item:hover { background: #e9eff5; }

.tab-item-active {
    background: var(--surface);
    color: var(--tab-active-text);
    font-weight: 700;
    height: 27px;
    border-color: #8fa8bd;
}

.tab-close {
    font-size: 14px;
    line-height: 1;
    color: #8a97a3;
    padding: 0 1px;
}

.tab-close:hover { color: var(--brand-red); font-weight: 700; }

.tab-scroll-buttons { display: flex; gap: 2px; padding-bottom: 2px; }

.tab-scroll {
    width: 18px;
    height: 20px;
    background: #f2f5f8;
    border: 1px solid #b9c6d2;
    border-radius: 2px;
    font-size: 9px;
    color: var(--ink-muted);
}

.tab-scroll:hover { background: #e0e8ef; }

.tab-close-all {
    align-self: center;
    margin: 0 6px 2px 4px;
    height: 22px;
    padding: 0 10px;
    background: linear-gradient(#fff, #f3d9d5);
    border: 1px solid #c58a80;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #96271b;
    white-space: nowrap;
}

.tab-close-all:hover { background: #f7dbd6; }

/* -- body / sidebar ------------------------------------------------------ */

.dashboard-body { flex: 1; display: flex; overflow: hidden; position: relative; }

.sidebar-toggle {
    width: 14px;
    background: #e3ebf2;
    border: none;
    border-right: 1px solid #c3d2de;
    color: var(--status-text);
    font-size: 9px;
    padding: 0;
}

.sidebar-toggle:hover { background: #d3e0ea; }

.sidebar-menu {
    width: 172px;
    background: #eaf2f9;
    border-right: 1px solid #b9c6d2;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-group { border-bottom: 1px solid #cfdde8; }

.sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    /* A caption long enough to wrap - "Patient Booking Advance, Admission and Discharge" - has to
       be allowed to grow, or its second line runs into the group above and below it. */
    min-height: 24px;
    padding: 4px 6px;
    background: linear-gradient(#cfe4f5, #b7d6ef);
    color: #14507f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    user-select: none;
}

.sidebar-group-title { flex: 1 1 auto; }

.sidebar-group-header:hover { background: linear-gradient(#c4dcf1, #a9cdea); }
.sidebar-group-header-open { background: linear-gradient(#bcd9f0, #9fc7e8); }
.sidebar-chevron { font-size: 8px; color: #2f6ea5; }

/* A section that reads apart from the rest, as the in-patient module's Operation Theater group
   does against its Consultant Menu - the same shape, a slate-grey instead of sky-blue. */
.sidebar-group-header-muted { background: linear-gradient(#dde3e9, #c5cfd8); color: #45566a; }
.sidebar-group-header-muted:hover { background: linear-gradient(#d3dae1, #b7c2cc); }
.sidebar-group-header-muted.sidebar-group-header-open { background: linear-gradient(#c9d2da, #adb9c4); }
.sidebar-group-header-muted .sidebar-chevron { color: #5a6b7d; }

.sidebar-items { list-style: none; margin: 0; padding: 2px 0; background: #f6fafd; }

.sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 6px 3px 10px;
    font-size: 12px;
    color: #21445e;
    cursor: pointer;
    line-height: 1.25;
}

.sidebar-item:hover { background: #dcecf8; }
.sidebar-item-active { background: #cfe4f5; font-weight: 600; }

.sidebar-item-icon {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    margin-top: 2px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.sidebar-item-icon-form { background: radial-gradient(circle at 35% 30%, #ffd88a, #d99b1f); }
.sidebar-item-icon-report { background: radial-gradient(circle at 35% 30%, #f4a09a, #c0392b); }

/* ==========================================================================
   Home tab - tiles
   ========================================================================== */

.dashboard-tab-content {
    flex: 1;
    display: flex;
    align-items: flex-start;
    /* The wall is a fixed 1032px block; centring it keeps it balanced on wide monitors
       instead of stranding it against the left edge. */
    justify-content: center;
    gap: var(--tile-gap);
    padding: 10px;
    overflow: auto;

    /* White fading into the brand green towards the lower right, as on the original console. */
    background:
        radial-gradient(115% 85% at 100% 100%, rgba(140, 198, 63, 0.42) 0%, rgba(140, 198, 63, 0) 58%),
        radial-gradient(90% 70% at 0% 0%, rgba(27, 154, 224, 0.10) 0%, rgba(27, 154, 224, 0) 60%),
        linear-gradient(160deg, #ffffff 0%, #f4fbff 45%, #eef7e4 100%);
}

/* Fixed columns: nothing stretches, so the arrangement is identical at every zoom level. */
.left-rail,
.right-column {
    display: flex;
    flex-direction: column;
    gap: var(--tile-gap);
    width: var(--rail-w);
    flex: 0 0 var(--rail-w);
}

.left-rail-row,
.right-extras-row { display: flex; gap: var(--tile-gap); }

.right-extras { display: flex; flex-direction: column; gap: var(--tile-gap); }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, var(--tile-w));
    grid-auto-rows: var(--tile-h);
    gap: var(--tile-gap);
    align-content: start;
    justify-content: start;
    flex: 0 0 auto;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 2px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: filter 0.12s ease, transform 0.12s ease;
}

.tile:hover { filter: brightness(1.08); }
.tile:active { transform: scale(0.985); }

.tile-normal { width: var(--tile-w); height: var(--tile-h); }
.tile-large { width: var(--rail-w); height: var(--tile-h); flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; }
.tile-wide { width: var(--rail-w); height: var(--tile-h); }

.tile-icon { width: 40px; height: 40px; flex-shrink: 0; }
.tile-icon svg { width: 100%; height: 100%; }
.tile-icon-large { width: 52px; height: 52px; }

.tile-label { font-size: 12px; line-height: 1.25; font-weight: 600; }
.tile-label-large { font-size: 19px; text-align: left; line-height: 1.18; }

.tile-white { background: #ffffff; color: var(--ink); border: 1px solid #d5dee6; }
.tile-greendark { background: #2f8f43; }
.tile-greensea { background: #1f8a5f; }
.tile-blue { background: #1c74c4; }
.tile-orange { background: #d98b1f; }
.tile-pink { background: #d94f8a; }
.tile-cyan { background: #22a3c9; }
.tile-maroon { background: #a03a2e; }
.tile-tan { background: #b08b4f; }
.tile-teal { background: #1a8fa0; }
.tile-purple { background: #7b5fa8; }
.tile-red { background: #c0392b; }

.tile-banner {
    width: var(--rail-w);
    height: var(--tile-h);
    background: #ffffff;
    border: 1px solid #d5dee6;
    color: var(--ink);
    gap: 2px;
    cursor: default;
}

.tile-banner:hover { filter: none; }
.tile-banner-logo { width: 46px; height: 46px; object-fit: contain; }
.tile-banner-name { font-size: 15px; font-weight: 700; color: var(--brand-blue); }
.tile-banner-subtitle { font-size: 10px; color: #6e8b3d; }

.badge-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #fff; border-radius: 4px; }
.badge-icon-mark { width: 84%; height: 84%; object-fit: contain; }

/* -- info panel ---------------------------------------------------------- */

.info-panel { display: flex; flex-direction: column; gap: var(--tile-gap); }

.info-box {
    height: var(--tile-h);
    padding: 10px 14px;
    border-radius: 2px;
    background: #7b5fa8;
    color: #fff;
}

.info-day { font-size: 20px; font-weight: 600; }
.info-date-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.info-date { font-size: 20px; font-weight: 700; }
.info-clock-icon svg { width: 38px; height: 38px; }
.info-time { font-size: 13px; margin-top: 4px; }

.info-box-user { background: #6b4f96; }
.info-welcome { font-size: 11px; opacity: 0.9; }
.info-username { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.info-detail { font-size: 10px; line-height: 1.5; }

