/* The colours of the GNET logo: its red, and its black for the sidebar. */
:root {
    --sidebar-width: 240px;
    --brand: #e62828;
    --brand-dark: #c41f1f;
    --brand-darker: #a81a1a;
    --brand-rgb: 230, 40, 40;
    --brand-tint: #fdeaea;
    --sidebar-bg: #111214;

    /* Bootstrap: what it calls primary is the brand red. */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand-dark);
    --bs-link-color-rgb: 196, 31, 31;
    --bs-link-hover-color: var(--brand-darker);
    --bs-link-hover-color-rgb: 168, 26, 26;
    --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}

/* Links are told apart by their colour, not by an underline. */
a, a:hover, a:focus { text-decoration: none; }

.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-darker); --bs-btn-active-border-color: var(--brand-darker);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-dark); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-color: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    --bs-btn-focus-shadow-rgb: var(--brand-rgb);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #f1a0a0; box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .2);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--brand); }
.pagination { --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .2); }

body {
    background: #f3f3f5; min-height: 100vh; color: #23262d;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .925rem; -webkit-font-smoothing: antialiased;
}
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 { color: #16181d; font-weight: 700; letter-spacing: -.01em; }
.text-secondary { color: #6c717c !important; }

.btn { font-weight: 500; border-radius: .45rem; }
.btn-primary { box-shadow: 0 1px 2px rgba(var(--brand-rgb), .3); }
.btn-outline-secondary { --bs-btn-color: #454952; --bs-btn-border-color: #d3d9e4; --bs-btn-hover-bg: #f1f3f8; --bs-btn-hover-color: #23262d; --bs-btn-hover-border-color: #c3cbd9; --bs-btn-active-bg: #e6e9f0; --bs-btn-active-color: #23262d; --bs-btn-active-border-color: #c3cbd9; }
.form-control, .form-select { border-color: #d3d9e4; border-radius: .45rem; font-size: .925rem; }
.form-control::placeholder { color: #a3adc2; }
.dropdown-menu { border-color: #e3e7ef; border-radius: .6rem; box-shadow: 0 10px 30px rgba(16, 24, 40, .1); font-size: .9rem; padding: .35rem; }
.dropdown-item { border-radius: .35rem; padding: .4rem .65rem; }
.alert { border: 0; border-left: 4px solid; border-radius: .5rem; }

/* Status badges: a tint with dark text. "Scheduled" and the like are not the
   brand red: red on a badge means a problem. */
.badge { padding: .38em .7em; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .01em; }
.badge.text-bg-primary { background-color: #dbeafe !important; color: #1e40af !important; }
.badge.text-bg-success { background-color: #dcfce7 !important; color: #166534 !important; }
.badge.text-bg-warning { background-color: #fef3c7 !important; color: #92400e !important; }
.badge.text-bg-danger { background-color: #fee2e2 !important; color: #991b1b !important; }
.badge.text-bg-info { background-color: #e0f2fe !important; color: #075985 !important; }
.badge.text-bg-secondary { background-color: #eef1f6 !important; color: #475569 !important; }
.badge.text-bg-dark { background-color: #e2e8f0 !important; color: #1e293b !important; }
.badge.text-bg-indigo { background-color: #e0e7ff; color: #3730a3; }

/* Sidebar */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 1040;
    background: var(--sidebar-bg); color: #c9ccd3; overflow-y: auto;
    transition: transform .2s ease;
}
/* The logo is drawn for a white ground, so it gets one. */
.sidebar-brand {
    display: block; padding: .7rem .9rem; background: #fff; border-bottom: 3px solid var(--brand);
}
.sidebar-brand img { display: block; width: 100%; height: auto; }
.sidebar-nav { padding: .75rem .6rem 2rem; }
.sidebar-section-label {
    padding: 1rem .75rem .35rem; font-size: .7rem; letter-spacing: .08em;
    text-transform: uppercase; color: #8b909c;
}
.sidebar-link {
    display: flex; align-items: center; gap: .7rem; padding: .5rem .75rem; margin-bottom: 2px;
    border-radius: .4rem; color: #c9ccd3; text-decoration: none; font-size: .9rem; font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.sidebar-link .bi { font-size: 1.05rem; opacity: .85; }
.sidebar-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-link.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(var(--brand-rgb), .35); }
.sidebar-link.active .bi { opacity: 1; }
.sidebar-backdrop { display: none; }

/* Main area */
.main-area { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; gap: .75rem; height: 58px; padding: 0 1.25rem;
    background: var(--sidebar-bg); border-bottom: 3px solid var(--brand); position: sticky; top: 0; z-index: 1020;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.topbar-title { font-weight: 600; color: #fff; }
.topbar-burger { border: 0; background: none; color: #fff; font-size: 1.5rem; line-height: 1; padding: 0; }
.topbar-user { display: flex; align-items: center; gap: .6rem; color: #e6e7ea; text-decoration: none; line-height: 1.2; }
.topbar-user { padding: .3rem .5rem; border-radius: .5rem; font-size: .88rem; }
.topbar-user:hover, .topbar-user.show { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar-user > .bi { font-size: 1.6rem; color: var(--brand); }
.topbar-user .text-secondary { color: #9a9ea8 !important; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .main-area { margin-left: 0; }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1030; }
}

/* The other menu layouts of Setup > Settings. "topbar": menus across the top
   bar, the sidebar left as what a phone opens. "dashboard": no sidebar, the
   menu is tiles. */
/* The logo is drawn for a white ground here too. */
.topbar-brand { padding: .25rem .5rem; border-radius: .4rem; background: #fff; }
.topbar-brand img { display: block; height: 30px; width: auto; }
.topbar-nav { align-items: center; gap: .15rem; margin-left: .5rem; }
.topbar-nav-link {
    display: flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border-radius: .4rem;
    color: #d5d7dc; font-size: .93rem; font-weight: 500; white-space: nowrap;
}
.topbar-nav-link:hover, .topbar-nav-link.show { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar-nav-link.active { background: var(--brand); color: #fff; }
.topbar-launcher {
    display: flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border: 1px solid rgba(255, 255, 255, .25);
    border-radius: .4rem; background: none; color: #fff; font-weight: 500;
}
.topbar-launcher:hover, .topbar-launcher.show { border-color: var(--brand); background: var(--brand); }
.launcher-menu { width: min(92vw, 560px); max-height: calc(100vh - 80px); overflow-y: auto; padding: .25rem 1rem 1rem; }
.menu-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; margin-top: .75rem; }
.menu-tiles-label { margin-top: 1rem; }
.menu-tile {
    display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .9rem .5rem;
    border: 1px solid #e3e7ef; border-radius: .6rem; background: #fff; color: #33363d;
    font-size: .85rem; font-weight: 500; text-align: center; line-height: 1.2;
}
.menu-tile .bi { font-size: 1.5rem; color: var(--brand); }
.menu-tile:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-darker); }
.menu-tile.active, .menu-tile.active .bi { background: var(--brand); border-color: var(--brand); color: #fff; }
.menu-card .card-body { padding-top: .25rem; }

body.layout-dashboard .main-area { margin-left: 0; }
@media (min-width: 992px) {
    body.layout-topbar .sidebar, body.layout-topbar .sidebar-backdrop { display: none; }
    body.layout-topbar .main-area { margin-left: 0; }
}

/* Cards and tables */
.card { border: 1px solid #e3e7ef; border-radius: .7rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 12px rgba(16, 24, 40, .03); }
.card > .table-responsive:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.card > .table-responsive:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.card-header { background: #fff; font-weight: 600; color: #16181d; padding: .85rem 1.1rem; border-bottom-color: #e9edf3; }
.card-body { padding: 1.1rem; }
.card-footer { background: #fafbfd; border-top-color: #e9edf3; padding: .8rem 1.1rem; }
.table { --bs-table-hover-bg: #f8f9fc; --bs-table-border-color: #e9edf3; }
.table > :not(caption) > * > * { vertical-align: middle; padding: .7rem 1.1rem; }
.table thead th {
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6c717c;
    white-space: nowrap; background: #fafbfd;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.page-link { color: #454952; border-color: #e3e7ef; }
.table-card { margin-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
dl.row { margin-bottom: 0; }
dl.row dd { margin-bottom: .45rem; }
.form-label { font-size: .85rem; font-weight: 500; margin-bottom: .25rem; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #6c717c; font-weight: 600; }

/* Dashboard tiles */
.stat { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.stat:hover { transform: translateY(-2px); border-color: #f1a0a0; box-shadow: 0 8px 20px rgba(16, 24, 40, .08); }
.stat-icon {
    width: 46px; height: 46px; border-radius: .6rem; display: grid; place-items: center;
    font-size: 1.3rem; background: var(--brand-tint); color: var(--brand); flex: none;
}
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.15; color: #16181d; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .82rem; color: #6c717c; }

/* The summary of the dashboard: red and black tiles, set like a chequerboard
   when four fit in a row. */
.stat-row .stat {
    position: relative; overflow: hidden; border: 0; color: #fff;
    background: linear-gradient(135deg, #2b2e35 0%, #0f1013 100%);
}
.stat-row > :nth-child(8n+1) .stat, .stat-row > :nth-child(8n+3) .stat,
.stat-row > :nth-child(8n+6) .stat, .stat-row > :nth-child(8n+8) .stat {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-darker) 100%);
}
.stat-row .stat::after {
    content: ""; position: absolute; right: -28px; bottom: -40px; width: 120px; height: 120px;
    border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.stat-row .stat-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.stat-row .stat-value { color: #fff; }
.stat-row .stat-label { color: rgba(255, 255, 255, .85); }
.stat-row .stat .text-secondary { color: rgba(255, 255, 255, .7) !important; }
.stat-row a.stat:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, .22); }

/* Workflow steps of an application */
.steps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.steps li {
    flex: 1 1 130px; padding: .55rem .8rem; border-radius: .4rem; background: #eef1f6; color: #6c717c;
    font-size: .85rem; font-weight: 600;
}
.steps li.done { background: #d9f2e3; color: #146c43; }
.steps li.current { background: var(--brand); color: #fff; }
.steps li.stopped { background: #f8d7da; color: #842029; }

/* Maps */
.map { height: 320px; border-radius: .5rem; border: 1px solid #d6dce8; z-index: 0; }
.map-picker { height: 380px; }
.map-full { height: calc(100vh - 230px); min-height: 420px; }
.map-pin {
    width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 4px rgba(0, 0, 0, .3);
}

/* Sign-in */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #15181e 0%, #3a1113 55%, #c41f1f 100%); padding: 1rem; }
.login-card { width: 100%; max-width: 400px; border: 0; border-radius: .8rem; border-top: 4px solid var(--brand); }
.login-logo { width: 100%; max-width: 280px; height: auto; }

/* Printed bill and receipt */
.document { background: #fff; border: 1px solid #e3e7ef; border-radius: .5rem; padding: 2rem; max-width: 860px; margin: 0 auto; }
.document h2 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.document .amount-due { font-size: 1.5rem; font-weight: 700; }

@media print {
    body { background: #fff; }
    .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
    .main-area { margin-left: 0; }
    main { padding: 0 !important; }
    .stat-row .stat, .stat-row .stat * { background: none !important; color: #000 !important; }
    .document { border: 0; padding: 0; max-width: none; }
}
