html {
  font-size: 14px;
}

:root {
  --brand-teal: #004050;
  --brand-teal-2: #005060;
  --brand-teal-dark: #002030;
  --brand-green: #60b020;
  --brand-green-2: #309030;
  --brand-ink: #0f172a;
  --brand-muted: #64748b;
  --brand-surface: #ffffff;
  --brand-page: #f4f8f6;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(96, 176, 32, 0.45);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  color: var(--brand-ink);
  background:
      radial-gradient(circle at top left, rgba(96, 176, 32, 0.12), transparent 28rem),
      linear-gradient(180deg, #ffffff 0, var(--brand-page) 280px);
  font-family: "Segoe UI", Arial, sans-serif;
}

.content {
    max-width: 100%;
}

.content .table {
    width: 100%;
    vertical-align: middle;
}

.content .card {
    overflow-wrap: anywhere;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

@media (max-width: 768px) {
    body {
        margin-bottom: 24px;
    }

    .content {
        padding: 12px;
    }

    .topbar {
        border-radius: 0;
        margin: -12px -12px 16px -12px;
        gap: 10px;
        padding: 12px;
    }

    .topbar-main {
        min-width: 0;
        gap: 8px !important;
        flex: 1 1 auto;
    }

    .topbar-brand-logo {
        width: 30px;
        height: 30px;
    }

    .system-title {
        flex: 0 0 auto;
        font-size: 16px;
        line-height: 1.15;
    }

    .system-title-full {
        display: none;
    }

    .system-title-short {
        display: inline;
    }

    .system-title::after {
        width: 32px;
        height: 2px;
        margin-top: 4px;
    }

    .content .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .btn {
        min-width: 0;
        width: auto;
    }

    .topbar .btn {
        padding: 8px 10px;
    }

    .topbar .dropdown-toggle {
        max-width: 132px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar .account-name {
        display: inline-block;
        max-width: 78px;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: bottom;
    }
}
.btn {
    min-width: 100px;
    border-radius: 8px;
    font-size: 15px;
    padding: 10px 14px;
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.system-title {
    margin: 0;
    color: var(--brand-teal-dark);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 750;
}

.system-title::after {
    content: "";
    display: block;
    width: 88px;
    height: 3px;
    margin-top: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-green));
}

.system-title-short {
    display: none;
}

.app-credit {
    margin-top: 24px;
    padding: 16px 4px 0;
    color: var(--brand-muted);
    font-size: 13px;
    text-align: right;
}

.app-credit strong {
    color: var(--brand-teal);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.login-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex: 0 0 auto;
}

.login-brand p {
    margin: 0 0 4px;
    color: var(--brand-teal);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.login-overview {
    margin: -4px 0 18px;
    padding: 14px;
    color: #334155;
    background: #f4f8f6;
    border: 1px solid #dbe8dd;
    border-left: 4px solid var(--brand-green);
    border-radius: 8px;
}

.login-overview strong {
    display: block;
    margin-bottom: 6px;
    color: var(--brand-teal-dark);
    font-size: 14px;
}

.login-overview p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.btn-primary {
    --bs-btn-bg: var(--brand-teal);
    --bs-btn-border-color: var(--brand-teal);
    --bs-btn-hover-bg: var(--brand-teal-2);
    --bs-btn-hover-border-color: var(--brand-teal-2);
    --bs-btn-active-bg: var(--brand-teal-dark);
    --bs-btn-active-border-color: var(--brand-teal-dark);
}

.hero-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    background: linear-gradient(135deg, var(--brand-teal-dark), var(--brand-teal), var(--brand-green-2));
    color: white;
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(0, 64, 80, 0.24);
}

.hero-panel h1,
.page-heading h1 {
    margin: 0;
    max-width: 900px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 750;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--brand-teal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-panel .eyebrow {
    color: #b9f7a3;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.metric-card {
    min-height: 128px;
    padding: 18px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.metric-card span {
    display: block;
    color: var(--brand-muted);
    font-size: 13px;
    font-weight: 650;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    color: var(--brand-ink);
    font-size: 32px;
    line-height: 1;
}

.metric-card small {
    display: block;
    margin-top: 12px;
    color: var(--brand-muted);
}

.metric-card.warning {
    border-left: 4px solid #f59e0b;
}

.metric-card.danger {
    border-left: 4px solid #ef4444;
}

.metric-card.success {
    border-left: 4px solid var(--brand-green);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
}

.surface {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(0, 64, 80, 0.06);
}

.surface h2,
.section-heading h2 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 750;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.table-modern {
    margin-bottom: 0;
}

.fleet-map {
    width: 100%;
    min-height: 520px;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
}

.empty-state {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6b7280;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
}

.table-modern thead th {
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    color: #0369a1;
    background: #e0f2fe;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.warning {
    color: #92400e;
    background: #fef3c7;
}

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

.status-pill.success {
    color: #065f46;
    background: #d1fae5;
}

.action-list {
    display: grid;
    gap: 10px;
}

.action-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--brand-ink);
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.action-list a:hover {
    background: #effbea;
}

.inspection-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.inspection-checks label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 650;
}

.incident-status-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(180px, 2fr) auto;
    gap: 8px;
    align-items: center;
}

.chatbot-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1100;
}

.chatbot-toggle {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, var(--brand-teal), var(--brand-green-2));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 14px 32px rgba(0, 64, 80, 0.28);
}

.chatbot-toggle i {
    font-size: 22px;
}

.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(360px, calc(100vw - 32px));
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px);
    background: white;
    border: 1px solid #dbe8dd;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.chatbot-widget.open .chatbot-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    color: white;
    background: linear-gradient(135deg, var(--brand-teal-dark), var(--brand-teal));
}

.chatbot-header strong,
.chatbot-header span {
    display: block;
}

.chatbot-header span {
    color: #b9f7a3;
    font-size: 12px;
}

.chatbot-header button,
.chatbot-form button {
    min-width: 0;
    border: 0;
}

.chatbot-header button {
    color: white;
    background: transparent;
}

.chatbot-messages {
    max-height: 320px;
    overflow-y: auto;
    display: grid;
    gap: 10px;
    padding: 14px;
    background: #f8fafc;
}

.chatbot-message {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.chatbot-message.bot {
    justify-self: start;
    color: #334155;
    background: white;
    border: 1px solid #e5e7eb;
}

.chatbot-message.user {
    justify-self: end;
    color: white;
    background: var(--brand-teal);
}

.chatbot-message a {
    display: inline-flex;
    margin-top: 8px;
    color: var(--brand-teal);
    font-weight: 700;
}

.chatbot-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chatbot-form input {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.chatbot-form button {
    width: 42px;
    height: 42px;
    color: white;
    background: var(--brand-teal);
    border-radius: 8px;
}

.install-help {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 1200;
    width: min(420px, calc(100vw - 28px));
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    color: #0f172a;
    background: white;
    border: 1px solid #dbe8dd;
    border-left: 4px solid var(--brand-green);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    transform: translateX(-50%);
}

.install-help[hidden] {
    display: none;
}

.install-help strong,
.install-help p {
    display: block;
}

.install-help p {
    margin: 3px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.35;
}

.install-help button {
    min-width: 0;
    padding: 2px 4px;
    color: #64748b;
    background: transparent;
    border: 0;
}

#calendar {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 6px;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .hero-panel {
        padding: 20px;
    }

    .hero-panel h1,
    .page-heading h1 {
        font-size: 24px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .incident-status-form {
        grid-template-columns: 1fr;
    }

    .chatbot-widget {
        right: 14px;
        bottom: 14px;
    }

    .chatbot-panel {
        width: calc(100vw - 28px);
    }

    .install-app-button {
        display: none;
    }
}
