﻿/* ================================
   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: #f5f7fb;
}

/* ================================
   Header & Footer
=================================== */

.tmis-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #1e293b;
    color: #f9fafb;
    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: #f5f7fb;
}

.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 {
    border-radius: 999px;
    padding-inline: 0.75rem;
    border: 1px solid #cbd5e1;
}

.tmis-icon-btn {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
    padding-inline: 0.5rem;
    border-radius: 6px;
}

    .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;
    border-radius: 6px;
}

    .tmis-logout-btn:hover {
        background: #dc2626;
        color: #ffffff;
    }

/* ================================
   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;
    flex-shrink: 0;
}

.tmis-auth-card {
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.2);
    padding: 2rem;
}

.tmis-auth-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.tmis-auth-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ================================
   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,
    .tmis-dashboard-tabs-bar > .btn {
        background-color: #0d6efd;
        color: #ffffff;
        border: none;
        border-radius: 0.375rem;
        padding: 0.4rem 0.85rem;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }

        .tmis-dashboard-tabs-bar .nav-link:hover,
        .tmis-dashboard-tabs-bar .btn:hover {
            background-color: #0b5ed7;
            color: #ffffff;
        }

        .tmis-dashboard-tabs-bar .nav-link.active {
            background-color: #0b5ed7;
            color: #ffffff;
        }

    .tmis-dashboard-tabs-bar .dropdown-menu {
        background-color: #ffffff;
        border-radius: 0.375rem;
        border: 1px solid #cbd5e1;
        padding: 0.25rem 0;
    }

        .tmis-dashboard-tabs-bar .dropdown-menu .dropdown-item {
            background-color: transparent !important;
            color: #111827 !important;
            border: none !important;
            border-radius: 0 !important;
            padding: 0.4rem 0.85rem;
            display: block;
        }

            .tmis-dashboard-tabs-bar .dropdown-menu .dropdown-item:hover {
                background-color: #e5e7eb !important;
                color: #111827 !important;
            }

/* Hide hamburger */
@media (min-width: 992px) {
    .tmis-dashboard-tabs-bar .navbar-toggler,
    .tmis-dashboard-tabs-bar .tmis-hamburger-toggle {
        display: none !important;
    }
}

/* ================================
   Settings Page
=================================== */

.tmis-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.tmis-settings-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.tmis-settings-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tmis-settings-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.tmis-settings-card-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.tmis-settings-card-body {
    padding: 0.85rem 1rem 0.95rem;
}

.tmis-settings-card-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

    .tmis-settings-card-links a {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.35rem 0.6rem;
        border-radius: 0.375rem;
        border: 1px solid #e5e7eb;
        background: #ffffff;
        text-decoration: none;
        font-size: 0.9rem;
        line-height: 1.2;
    }

        .tmis-settings-card-links a:hover {
            background: #e5edff;
            border-color: #0d6efd;
        }

/* ================================
   Settings "gear" icon
=================================== */

.tmis-settings-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    font-size: 1.25rem;
    color: #0d6efd;
}

/* ================================
   Manage Users
=================================== */

.manage-users-table-wrapper {
    background: #ffffff;
}

.manage-users-table {
    width: 100%;
}

@media (max-width: 900px) {
    .manage-users-table {
        table-layout: fixed;
        font-size: 0.75rem;
    }
}

/* ================================
   Dashboard Layout
=================================== */

.tmis-dashboard-row {
    min-height: calc(100vh - 7rem);
}

/* ⭐ TRUE 5-COLUMN LAYOUT (full-width, no sidebar) */
.tmis-dashboard-grid .col-lg-2 {
    flex: 0 0 20% !important;
    max-width: 20% !important;
}

/* ================================
   Unified Tasks/SMS Cards
=================================== */

.tmis-tasks-card {
    display: flex;
    flex-direction: column;
    max-height: 340px;
    background: #ffffff;
    border-radius: 0.5rem;
}

.tmis-tasks-card-scroll {
    max-height: 260px;
    overflow-y: auto;
    padding: 0.5rem;
}

/* ================================
   Drag & Drop
=================================== */

.tmis-drag-handle {
    cursor: grab;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    margin-right: 6px;
    margin-top: 4px;
}

.tmis-grip-dots {
    width: 8px;
    height: 14px;
    display: inline-block;
    background-image: radial-gradient(currentColor 1.4px, transparent 1.4px), radial-gradient(currentColor 1.4px, transparent 1.4px), radial-gradient(currentColor 1.4px, transparent 1.4px), radial-gradient(currentColor 1.4px, transparent 1.4px), radial-gradient(currentColor 1.4px, transparent 1.4px), radial-gradient(currentColor 1.4px, transparent 1.4px);
    background-size: 3px 3px;
    background-repeat: no-repeat;
    background-position: 0 0, 4px 0, 0 4px, 4px 4px, 0 8px, 4px 8px;
}

.tmis-card-dragging {
    opacity: 0.5;
    border: 2px dashed #0d6efd;
}

.tmis-column-dropzone {
    min-height: 20px;
    padding: 6px;
    border: 1px dashed #d0d6e1;
    border-radius: 6px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.75rem;
    color: #9aa0ab;
    user-select: none;
}

/* ================================
   Dark Mode
=================================== */

html.dark-mode,
body.dark-mode {
    background-color: #020617;
    color: #e5e7eb;
}

    /* Main app background */
    html.dark-mode .tmis-body {
        background: #020617;
    }

    /* Scrollable main area */
    html.dark-mode .tmis-main {
        background: #020617;
    }

    /* Header & footer */
    html.dark-mode .tmis-header {
        background: #020617;
        color: #e5e7eb;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    }

    html.dark-mode .tmis-footer {
        background: #020617;
        color: #9ca3af;
    }

    /* Dashboard tabs bar */
    html.dark-mode .tmis-dashboard-tabs-bar {
        background: #111827;
        border-bottom-color: #1f2937;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    }

        html.dark-mode .tmis-dashboard-tabs-bar .nav-link,
        html.dark-mode .tmis-dashboard-tabs-bar .btn,
        html.dark-mode .tmis-dashboard-tabs-bar > .btn {
            background-color: #1d4ed8;
            color: #f9fafb;
        }

            html.dark-mode .tmis-dashboard-tabs-bar .nav-link:hover,
            html.dark-mode .tmis-dashboard-tabs-bar .btn:hover {
                background-color: #2563eb;
                color: #f9fafb;
            }

        html.dark-mode .tmis-dashboard-tabs-bar .dropdown-menu {
            background-color: #020617;
            border-color: #1f2937;
        }

            html.dark-mode .tmis-dashboard-tabs-bar .dropdown-menu .dropdown-item {
                background-color: transparent !important;
                color: #e5e7eb !important;
            }

                html.dark-mode .tmis-dashboard-tabs-bar .dropdown-menu .dropdown-item:hover {
                    background-color: #111827 !important;
                    color: #f9fafb !important;
                }

    /* Dark mode: keep “content” cards light & readable */
    html.dark-mode .tmis-settings-card,
    html.dark-mode .tmis-tasks-card,
    html.dark-mode .tmis-auth-card,
    html.dark-mode .manage-users-table-wrapper,
    html.dark-mode .card {
        background: #f9fafb;
        color: #111827;
        border-color: #1f2937;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    html.dark-mode .tmis-settings-card-header {
        background: #e5e7eb;
        border-bottom-color: #d1d5db;
    }

    html.dark-mode .tmis-settings-card-title,
    html.dark-mode .tmis-settings-card-subtitle {
        color: #111827;
    }

    html.dark-mode .tmis-settings-card-links a {
        background: #ffffff;
        border-color: #d1d5db;
        color: #111827;
    }

        html.dark-mode .tmis-settings-card-links a:hover {
            background: #e5edff;
            border-color: #2563eb;
        }

    /* Dark mode: Bootstrap modals (Add Task, Configure Dashboard, etc.) */
    html.dark-mode .modal-content {
        background-color: #ffffff;
        color: #111827;
    }

        html.dark-mode .modal-content .modal-title,
        html.dark-mode .modal-content label,
        html.dark-mode .modal-content .form-control,
        html.dark-mode .modal-content .form-select,
        html.dark-mode .modal-content .form-check-label,
        html.dark-mode .modal-content .text-muted {
            color: #111827;
        }

/* Light mode header: outline-light buttons (e.g., Logout) should be visible */
html:not(.dark-mode) .tmis-header .btn-outline-light {
    color: #f9fafb;
    border-color: #f9fafb;
}
