/*
 * TomaShift — custom theme
 * Colors drawn from Tomahawk Internet Technologies branding:
 *   Orange  #F5A623  (logo text / tomahawk)
 *   Dark    #1C1C1C  (logo outlines / navbar)
 *   Crimson #8B1A1A  (tomahawk-and-sickle icon)
 *   Warm bg #F5EFE6  (earthy neutral from warrior palette)
 */

:root {
    --ts-orange:      #F5A623;
    --ts-orange-dark: #D4891A;
    --ts-dark:        #1C1C1C;
    --ts-crimson:     #8B1A1A;
    --ts-warm-bg:     #F5EFE6;
}

/* ── Global ────────────────────────────────────────────── */

body {
    background-color: var(--ts-warm-bg);
}

/* ── Navbar ────────────────────────────────────────────── */

.ts-navbar {
    background-color: var(--ts-dark) !important;
    border-bottom: 2px solid var(--ts-orange);
}

.ts-navbar .ts-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.ts-navbar .ts-brand img {
    height: 36px;
    width: auto;
}

.ts-navbar .ts-brand-name {
    color: var(--ts-orange);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    line-height: 1;
}

.ts-navbar .nav-link {
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.15s;
}

.ts-navbar .nav-link:hover,
.ts-navbar .nav-link.active {
    color: var(--ts-orange);
}

.ts-navbar .ts-employee-info {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.83rem;
    white-space: nowrap;
}

.ts-navbar .btn-ts-logout {
    border-color: var(--ts-orange);
    color: var(--ts-orange);
    font-size: 0.85rem;
}

.ts-navbar .btn-ts-logout:hover {
    background-color: var(--ts-orange);
    color: var(--ts-dark);
    font-weight: 600;
}

.ts-navbar-toggler {
    border: 2px solid var(--ts-orange) !important;
    background-color: rgba(245, 166, 35, 0.15) !important;
    padding: 6px 10px !important;
}

.ts-navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.5) !important;
}

.ts-navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23F5A623' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.5em !important;
    height: 1.5em !important;
}

.ts-navbar-tits-logo {
    height: 40px;
    width: auto;
}

.ts-tits-logo-link {
    line-height: 0;
}

/* ── Buttons ───────────────────────────────────────────── */

.btn-ts {
    background-color: var(--ts-orange);
    border-color: var(--ts-orange);
    color: var(--ts-dark);
    font-weight: 600;
}

.btn-ts:hover,
.btn-ts:focus {
    background-color: var(--ts-orange-dark);
    border-color: var(--ts-orange-dark);
    color: var(--ts-dark);
}

/* ── Cards ─────────────────────────────────────────────── */

.ts-card-header {
    background-color: var(--ts-dark);
    color: #fff;
    border-bottom: 2px solid var(--ts-orange);
}

/* ── Login page ────────────────────────────────────────── */

body.ts-login-page {
    background-color: var(--ts-dark);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    margin: 0;
}

.ts-login-split {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Warrior portrait — left panel (fixed ~400px, roughly half its previous size) */
.ts-login-warrior {
    flex: 0 0 400px;
    background-image: url('../images/TomaWarrior.jpg');
    background-size: cover;
    background-position: center top;
    position: relative;
}

.ts-login-warrior::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(28, 28, 28, 0.10) 0%,
        rgba(28, 28, 28, 0.50) 100%
    );
}

/* Form panel — right side */
.ts-login-form-panel {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;          /* center everything horizontally */
    padding: 0 2.5rem;
    background-color: #fff;
    overflow-y: auto;
}

/* ── Top branding block ── */
.ts-login-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 2rem;
    width: 100%;
}

.ts-login-logo {
    max-width: 300px;
    width: 100%;
    margin-bottom: 1.25rem;
}

.ts-customer-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-top: 1rem;
}

.ts-login-form {
    text-align: center;
}

.ts-field-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ts-field-label {
    flex-shrink: 0;
    width: 80px;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
    margin: 0;
}

.ts-field-row .form-control {
    flex: 1;
}

.ts-login-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--ts-orange);
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
    line-height: 1;
}

.ts-login-project-name {
    font-size: 0.62rem;
    font-style: italic;
    color: #bbb;
    margin-bottom: 0;
    line-height: 1.4;
    max-width: 280px;
}

/* ── Form section (grows to push footer down) ── */
.ts-login-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 340px;
    padding-top: 2rem;
}

.ts-login-subtitle {
    color: #888;
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.ts-login-form-section .alert {
    width: 100%;
}

.ts-login-form-section form {
    width: 100%;
}

.ts-login-form-panel .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
}

/* ── Footer ── */
.ts-login-footer {
    padding: 1.5rem 0 2rem;
    text-align: center;
    font-size: 0.78rem;
    color: #999;
    line-height: 1.8;
}

.ts-login-footer a {
    color: var(--ts-orange);
    text-decoration: none;
}

.ts-login-footer a:hover {
    text-decoration: underline;
}

/* Login form inputs — left-aligned text */
.ts-login-form-panel input.form-control {
    text-align: left;
}

/* Collapse warrior on small screens */
@media (max-width: 767px) {
    .ts-login-warrior {
        display: none;
    }
    .ts-login-form-panel {
        padding: 0 1.5rem;
    }
}

/* ── Dashboard welcome strip ───────────────────────────── */

.ts-warrior-sidebar img {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    object-fit: cover;
    max-height: 420px;
}

/* ── Mobile responsiveness ─────────────────────────────────────────────── */

/* Tables — horizontal scroll on small screens instead of breaking layout */
.table-responsive-stack {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Calendar — minimum usable height on phones */
#calendar-wrap {
    min-height: 400px;
}

/* Schedule grid in reports — always scrollable */
.ts-schedule-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Notices scroll area */
.ts-notices-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Stat cards — stack on very small screens */
@media (max-width: 576px) {
    .ts-stat-card-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Navbar — on mobile, tighten the right-side controls */
@media (max-width: 991px) {
    .ts-employee-info {
        display: none !important;
    }
    .ts-navbar .navbar-collapse {
        padding-bottom: 0.5rem;
    }
    .ts-navbar .nav-link {
        padding: 0.4rem 0.75rem;
    }
}

/* Report filter bars — stack on mobile */
@media (max-width: 768px) {
    .ts-report-filters .col-md-2,
    .ts-report-filters .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Calendar — reduce height on phones, use more vertical space */
@media (max-width: 768px) {
    #calendar-wrap {
        height: 60vh !important;
    }
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    .fc .fc-toolbar-title {
        font-size: 1rem;
    }
    .fc .fc-button {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Login page — stack on very small screens */
@media (max-width: 768px) {
    .ts-login-warrior {
        display: none !important;
    }
    .ts-login-form-panel {
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 1.5rem !important;
    }
}

/* Cards — remove horizontal padding on phones */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .card-body {
        padding: 0.75rem;
    }
}

/* ── Print styles ───────────────────────────────────────────────────────── */
@media print {
    .ts-navbar,
    .btn,
    #deptFilter,
    .ts-scheme-selector,
    .ts-legend-wrap,
    .fc-toolbar-chunk:last-child {
        display: none !important;
    }
    #calendar-wrap {
        height: auto !important;
        min-height: 0 !important;
    }
    .fc-view-harness {
        height: auto !important;
    }
    body {
        background: #fff !important;
    }
    .card, .shadow-sm {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
