﻿/* ================================
   Base
=================================== */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.tmis-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #ffffff;
    color: #111827;
}

/* Remove rounding globally */
* {
    border-radius: 0 !important;
}

/* ================================
   Header & Footer
=================================== */

.tmis-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #1e293b;
    color: #ffffff;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.3);
}

.tmis-header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.tmis-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tmis-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tmis-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #0f172a;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    z-index: 1000;
    font-size: 0.8rem;
}

/* ================================
   Main Area
=================================== */

.tmis-main {
    position: absolute;
    top: 64px;
    bottom: 50px;
    left: 0;
    right: 0;
    overflow-y: auto;
    background: #ffffff;
}

.tmis-content {
    min-height: 100%;
}

/* ================================
   Branding
=================================== */

.tmis-logo-text {
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 1rem;
}

.tmis-logo-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ================================
   Header Buttons
=================================== */

.tmis-search-form {
    min-width: 220px;
}

.tmis-search-input {
    padding-inline: 0.75rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
}

.tmis-icon-btn {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #ffffff;
    padding-inline: 0.5rem;
}

    .tmis-icon-btn:hover {
        background: rgba(15, 23, 42, 0.8);
    }

.tmis-logout-btn {
    background: #ef4444;
    border-color: transparent;
    color: #ffffff;
    padding: 0.3rem 0.75rem;
}

    .tmis-logout-btn:hover {
        background: #dc2626;
    }

/* ================================
   Auth Layout
=================================== */

.tmis-auth-wrapper {
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.tmis-auth-inner {
    width: 100%;
    max-width: 420px;
}

.tmis-auth-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.2);
    padding: 2rem;
}

/* ================================
   Dashboard Tabs Bar
=================================== */

.tmis-dashboard-tabs-bar {
    width: 100%;
    background: #e5e7eb;
    border-bottom: 1px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

    .tmis-dashboard-tabs-bar .nav-link,
    .tmis-dashboard-tabs-bar .btn {
        background-color: #0d6efd;
        color: #ffffff;
        border: none;
        padding: 0.4rem 0.85rem;
    }

        .tmis-dashboard-tabs-bar .nav-link:hover,
        .tmis-dashboard-tabs-bar .btn:hover {
            background-color: #0b5ed7;
        }

        .tmis-dashboard-tabs-bar .nav-link.active {
            background-color: #0b5ed7;
        }

    .tmis-dashboard-tabs-bar .dropdown-menu {
        background-color: #ffffff;
        border: 1px solid #cbd5e1;
    }

    .tmis-dashboard-tabs-bar .dropdown-item {
        background: transparent !important;
        color: #111827 !important;
    }

        .tmis-dashboard-tabs-bar .dropdown-item:hover {
            background: #e5e7eb !important;
        }

@media (min-width: 992px) {
    .tmis-dashboard-tabs-bar .navbar-toggler,
    .tmis-dashboard-tabs-bar .tmis-hamburger-toggle {
        display: none !important;
    }
}

/* ================================
   Settings Page Card Layout
=================================== */

.tmis-settings-grid-modern {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.tmis-settings-card-modern {
    background: #ffffff;
    border: 1px solid #d1d5db;
}

.tmis-settings-card-header-modern {
    padding: 0.75rem 1rem;
    background: #f1f3f5;
    border-bottom: 1px solid #d1d5db;
}

    .tmis-settings-card-header-modern h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
        color: #0f172a;
    }

    .tmis-settings-card-header-modern p {
        margin: 0.25rem 0 0;
        font-size: 0.8rem;
        color: #64748b;
    }

.tmis-settings-card-body-modern {
    padding: 1rem;
    display: grid;
    gap: 0.5rem;
}

.tmis-settings-link-modern {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    text-decoration: none;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .tmis-settings-link-modern:hover {
        background: #e6ecff;
        border-color: #0d6efd;
        color: #0d6efd;
    }

/* ================================
   Shell (page wrapper)
=================================== */

.tmis-shell-container {
    max-width: 1300px;
    padding: 1rem;
}

.tmis-shell-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
}

.tmis-shell-card-body {
    padding: 1.5rem;
}

.tmis-shell-card h2 {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #111827;
}

.tmis-shell-card .text-muted {
    color: #6b7280 !important;
}

/* ================================
   Tables
=================================== */

.table {
    background: #ffffff;
    color: #111827;
}

    .table thead th {
        background: #f1f3f5;
        color: #111827;
    }

.table-hover tbody tr:hover {
    background-color: #eef2ff;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafafa;
}

/* ================================
   DARK MODE — Global
=================================== */

html.dark-mode,
body.dark-mode {
    background-color: #020617 !important;
    color: #ffffff !important;
}

    html.dark-mode .tmis-body,
    html.dark-mode .tmis-main {
        background: #020617 !important;
    }

    html.dark-mode .tmis-header,
    html.dark-mode .tmis-header * {
        color: #ffffff !important;
    }

    html.dark-mode .tmis-dashboard-tabs-bar {
        background: #111827 !important;
    }

    html.dark-mode .breadcrumb,
    html.dark-mode .breadcrumb-item a {
        color: #ffffff !important;
    }

    html.dark-mode .tmis-shell-card {
        background: #0b1220 !important;
        border-color: #2b3544 !important;
    }

    html.dark-mode input,
    html.dark-mode select,
    html.dark-mode textarea {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #ffffff !important;
    }

/* ================================
   Logos
=================================== */

.company-brand-logo {
    max-width: 250px;
    max-height: 75px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* =============================================================
   TMIS GLOBAL VALIDATION + ERROR HIGHLIGHTING
   ============================================================= */

.field-error {
    color: #c62828 !important;
    font-weight: 600;
}

input:invalid,
select:invalid,
textarea:invalid {
    border-color: #c62828 !important;
}

input,
select,
textarea {
    transition: border-color 0.25s ease;
}

.validation-message {
    color: #c62828 !important;
    font-size: 0.85rem;
    margin-top: 2px;
}

html.dark-mode input:invalid,
html.dark-mode select:invalid,
html.dark-mode textarea:invalid {
    border-color: #ff6b6b !important;
}

html.dark-mode .validation-message {
    color: #ff6b6b !important;
}

label.tmis-required::after {
    content: " *";
    color: #d32f2f;
    font-weight: bold;
}

.tmis-card-error {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.25) !important;
}

html.dark-mode .tmis-card-error {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.35) !important;
}

/* SERVICE TYPE TOGGLES */

.service-type-toggle-container {
    display: flex;
    align-items: center;
    gap: 22px;
}

.service-type-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    cursor: pointer;
}

    .service-type-toggle input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

.tmis-editor-design {
    min-height: 240px !important;
    height: 240px !important;
    overflow: auto;
}

/* =============================================================
   TMIS DASHBOARD GRID (RESPONSIVE)
   ============================================================= */

.tmis-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    align-items: flex-start;
}

@media (max-width: 1400px) {
    .tmis-dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .tmis-dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .tmis-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .tmis-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.tmis-dashboard-column {
    min-height: 40px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tmis-sortable-card-wrapper {
    background: inherit;
    border: 1px solid #d1d5db;
    cursor: grab;
}

    .tmis-sortable-card-wrapper.tmis-card-dragging {
        opacity: 0.6;
        cursor: grabbing;
    }

html.dark-mode .tmis-sortable-card-wrapper {
    background: #0b1220;
    border-color: #2b3544;

}
/* =============================================================
   DASHBOARD DARK MODE FIX (BOOTSTRAP OVERRIDE)
   ============================================================= */

html.dark-mode .container,
html.dark-mode .container-fluid {
    background-color: transparent !important;
}

/* Ensure dashboard grid inherits dark background */
html.dark-mode .tmis-dashboard-grid {
    background-color: transparent !important;
}

/* Force widget cards to dark surface */
html.dark-mode .tmis-sortable-card-wrapper {
    background-color: #0b1220 !important;
    border-color: #2b3544 !important;
}

