﻿* {
    box-sizing: border-box;
}

:root {
    --ttt-navy: #083050;
    --ttt-navy-dark: #06243d;
    --ttt-gold: #e0b860;
    --ttt-gold-dark: #c58b10;
    --ttt-bg: #f4f7fb;
    --ttt-text: #0b2440;
    --ttt-muted: #536277;
    --ttt-border: #e6ebf2;
    --ttt-white: #ffffff;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

    body.ttt-body,
    body.ttt-body * {
        font-family: Tahoma, Arial, sans-serif !important;
    }

    body.ttt-body {
        direction: rtl;
        text-align: right;
        background: var(--ttt-bg);
        color: var(--ttt-text);
    }

/* ===== HEADER ===== */

.ttt-header-new {
    background: linear-gradient(180deg, var(--ttt-navy) 0%, var(--ttt-navy-dark) 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
    position: relative;
    z-index: 9999;
}

.ttt-header-top {
    height: 132px;
    min-height: 132px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ttt-brand {
    text-align: center;
}

.ttt-brand-logo {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 88px;
    height: 88px;
    object-fit: contain;
    background: white;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.ttt-brand h2 {
    color: var(--ttt-gold);
    font-size: 24pt;
    font-weight: 900;
    margin: 0 0 8px 0;
}

.ttt-brand span {
    color: white;
    font-size: 13pt;
    font-weight: 800;
    display: block;
}

    .ttt-brand span::after {
        content: "";
        display: block;
        width: 190px;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--ttt-gold), transparent);
        margin: 14px auto 0;
    }

/* ===== USER PANEL ===== */

.ttt-user-panel {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 230px;
    min-width: 230px;
    z-index: 1000000;
}

.ttt-user-panel-head {
    min-width: 230px;
    height: 78px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    color: white;
}

.ttt-user-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ttt-gold);
    background: white;
}

.ttt-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    white-space: nowrap;
}

    .ttt-user-info strong {
        color: white;
        font-size: 10.5pt;
    }

    .ttt-user-info span {
        color: var(--ttt-gold);
        font-size: 9pt;
    }

.ttt-user-panel-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 230px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
    overflow: hidden;
    text-align: right;
}

.ttt-user-panel:hover .ttt-user-panel-menu,
.ttt-user-panel.open .ttt-user-panel-menu {
    display: block;
}

.ttt-user-panel-menu a,
.ttt-user-panel-menu button {
    display: block;
    width: 100%;
    padding: 11px 15px;
    background: white;
    color: var(--ttt-text);
    border: none;
    text-align: right;
    text-decoration: none;
    font-size: 10pt;
    cursor: pointer;
}

    .ttt-user-panel-menu a:hover,
    .ttt-user-panel-menu button:hover {
        background: #f5f7fa;
        color: var(--ttt-gold-dark);
    }

.ttt-user-panel-menu form {
    margin: 0;
}

/* ===== MENU ===== */

.ttt-header-menu-row {
    height: 64px;
    background: var(--ttt-navy-dark);
    border-top: 1px solid rgba(224, 184, 96, .25);
    border-bottom: 4px solid var(--ttt-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 9998;
}

.ttt-menu-new {
    width: 100%;
    max-width: none;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(6px, .8vw, 18px);
    padding: 0 clamp(10px, 1.25vw, 28px);
}

    .ttt-menu-new > a,
    .ttt-menu-new .ttt-dropdown > a {
        color: white !important;
        font-size: clamp(13px, .83vw, 16px);
        font-weight: 800;
        white-space: nowrap;
        text-decoration: none;
        padding: 19px 4px;
        display: block;
    }

        .ttt-menu-new > a:hover,
        .ttt-menu-new .ttt-dropdown > a:hover {
            color: var(--ttt-gold) !important;
        }

.ttt-dropdown {
    position: relative;
}

.ttt-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 245px;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    overflow: hidden;
    z-index: 999999;
    text-align: right;
}

.ttt-dropdown:hover .ttt-dropdown-content {
    display: block;
}

/* آخرین منوی سمت چپ باید به داخل صفحه باز شود، نه بیرون پنجره مرورگر. */
.ttt-menu-new > .ttt-dropdown:last-child > .ttt-dropdown-content {
    right: auto;
    left: 0;
}

.ttt-dropdown-content a {
    display: block;
    color: var(--ttt-text) !important;
    text-decoration: none;
    padding: 12px 16px;
    font-size: 11pt;
    border-bottom: 1px solid #eef1f5;
    white-space: nowrap;
}

    .ttt-dropdown-content a:hover {
        background: #f8fafc;
        color: var(--ttt-gold-dark) !important;
    }



/* ===== NESTED MANAGEMENT MENUS ===== */
.ttt-submenu {
    position: relative;
}

.ttt-submenu-trigger {
    font-weight: 800;
}

.ttt-submenu-content {
    display: none;
    position: absolute;
    top: 0;
    right: 100%;
    min-width: 270px;
    max-height: 70vh;
    overflow-y: auto;
    background: white;
    border-radius: 12px 0 12px 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    z-index: 1000000;
}

.ttt-submenu:hover > .ttt-submenu-content {
    display: block;
}

.ttt-submenu-content a:last-child {
    border-bottom: 0;
}

@media (max-width: 992px) {
    .ttt-submenu-content {
        position: static;
        min-width: 100%;
        max-height: none;
        box-shadow: none;
        border-radius: 0;
        border-right: 3px solid #eef1f5;
    }
}

/* ===== MAIN ===== */

.ttt-main-new {
    padding: 44px 30px;
}

.ttt-footer {
    text-align: center;
    color: #6b7280;
    padding: 22px;
    font-size: 10pt;
}

/* ===== DASHBOARD ===== */

.dashboard-page {
    max-width: 1220px;
    margin: 0 auto;
}

.quick-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 34px;
}

.quick-card {
    min-height: 130px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 24px;
    background: white;
    box-shadow: 0 10px 28px rgba(8, 48, 80, .08);
    border: 1px solid var(--ttt-border);
}

    .quick-card span {
        font-weight: 800;
        color: var(--ttt-navy);
    }

    .quick-card strong {
        color: var(--ttt-gold-dark);
        font-size: 26pt;
    }

    .quick-card::before {
        content: "";
        width: 58px;
        height: 58px;
        border-radius: 50%;
        background: #f1f4f8;
        grid-row: 1 / span 2;
        grid-column: 2;
    }

.modules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.module-card {
    min-height: 150px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 10px 28px rgba(8, 48, 80, .08);
    border: 1px solid var(--ttt-border);
    display: grid;
    grid-template-columns: 1fr 70px;
    align-items: center;
    text-align: right;
    padding: 28px;
    transition: .25s ease;
    text-decoration: none !important;
    color: var(--ttt-text) !important;
}

    .module-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 34px rgba(8, 48, 80, .14);
    }

    .module-card h3 {
        color: var(--ttt-navy);
        font-size: 19pt;
        font-weight: 900;
        margin: 0 0 10px 0;
    }

    .module-card p {
        color: var(--ttt-muted);
        font-size: 11pt;
        line-height: 1.9;
        margin: 0;
    }

    .module-card::after {
        content: "";
        width: 62px;
        height: 62px;
        border-radius: 50%;
        background: #f1f4f8;
        grid-column: 2;
        grid-row: 1 / span 2;
    }

/* ===== CARDS / TABLE / FORMS ===== */

.card,
.page-card {
    background: white;
    border: 1px solid var(--ttt-border);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .06);
    padding: 24px;
}

.card-header {
    background: #f8fafc;
    color: var(--ttt-text);
    font-weight: bold;
    border-bottom: 1px solid var(--ttt-border);
}

.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    vertical-align: middle;
    text-align: center;
}

    .table th {
        background: var(--ttt-navy) !important;
        color: white !important;
        font-weight: bold;
        text-align: center;
        vertical-align: middle;
        font-size: 14px;
    }

    .table td {
        text-align: center;
        vertical-align: middle;
    }

    .table tbody tr:hover {
        background: #f3f6fa !important;
    }

.form-control,
.form-select,
textarea,
select {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    min-height: 40px;
    direction: rtl;
    text-align: right;
}

    .form-control:focus,
    .form-select:focus,
    textarea:focus {
        border-color: var(--ttt-gold);
        box-shadow: 0 0 0 .2rem rgba(224, 184, 96, .22);
    }

label {
    font-weight: bold;
    margin-bottom: 5px;
}

/* ===== BUTTONS ===== */

.btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 6px 14px !important;
    min-width: 110px;
}

.btn-sm {
    min-width: 80px;
}

a.btn-info,
button.btn-info,
.btn-view,
.btn-details {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
}

a.btn-warning,
button.btn-warning,
.btn-edit {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #111 !important;
}

a.btn-success,
button.btn-success,
.btn-add,
.btn-create {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
}

button.btn-primary,
input[type="submit"].btn-primary,
.btn-search {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

a.btn-danger,
button.btn-danger,
.btn-delete {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.btn-secondary {
    background: #64748b !important;
    border-color: #64748b !important;
    color: white !important;
}

/* ===== LOGIN ===== */

.login-page {
    min-height: calc(100vh - 250px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 460px;
    background: white;
    border-radius: 18px;
    border-top: 5px solid var(--ttt-gold);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
    padding: 34px;
}

    .login-box h2 {
        text-align: center;
        color: var(--ttt-navy);
        font-size: 18pt;
        font-weight: 800;
    }

    .login-box p {
        text-align: center;
        color: var(--ttt-gold-dark);
        font-weight: 700;
        margin-bottom: 26px;
    }

    .login-box .btn-primary {
        background: var(--ttt-navy) !important;
        border-color: var(--ttt-navy) !important;
        min-height: 44px;
    }

/* ===== PLATE ===== */

.plate-iran-style {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    max-width: 520px;
    background: #f8fafc;
    border: 1px solid #d6dbe3;
    border-radius: 12px;
    padding: 8px;
}

.plate-part {
    width: 72px !important;
    min-width: 72px !important;
    font-weight: bold;
    direction: ltr !important;
    text-align: center !important;
}

.plate-letter {
    width: 85px !important;
    min-width: 85px !important;
    font-weight: bold;
    text-align: center !important;
}

.plate-dash {
    font-weight: bold;
    font-size: 18px;
}

.plate-iran-label {
    background: #eef2f7;
    border: 1px solid #d6dbe3;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: bold;
    color: #1f2937;
}

/* ===== TRANSPORTATION PAGES ===== */

.outing-page {
    max-width: 1450px;
    margin: 36px auto;
    padding: 0 28px;
}

.outing-card {
    background: #ffffff;
    border: 1px solid #e1e7ef;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 14px 34px rgba(15, 47, 74, 0.08);
    overflow: hidden;
}

.outing-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

    .outing-card-header h2 {
        margin: 0;
        font-size: 26px;
        font-weight: 800;
        color: #0b2f4a;
    }

.outing-card .form-label {
    font-weight: 800;
    color: #0b2f4a;
    margin-bottom: 7px;
}

.outing-card .form-control,
.outing-card .form-select {
    height: 46px;
    border-radius: 9px;
    border-color: #d3dbe6;
    background-color: #fff;
}

.outing-card textarea.form-control {
    height: auto;
    min-height: 125px;
}

.outing-actions {
    margin-top: 26px;
    display: flex;
    justify-content: flex-end;
}

/* ===== TIME SELECT ===== */

.time-select-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    max-width: 330px;
    direction: rtl;
}

.time-select {
    width: 135px !important;
    min-width: 135px !important;
}

.time-colon {
    font-weight: 800;
    color: #0b2f4a;
}

/* ===== DATE INPUT ===== */

.date-input-wrap {
    position: relative;
}

    .date-input-wrap .form-control {
        padding-left: 42px;
    }

.date-icon {
    position: absolute;
    left: 14px;
    top: 11px;
    color: #56667a;
    font-size: 16px;
}

/* ===== OUTING TABLE ===== */

.outing-card .table-responsive {
    overflow-x: auto;
    padding-bottom: 6px;
}

.outing-table {
    width: 100%;
    min-width: 1180px;
    table-layout: auto;
    margin: 0;
    border: 1px solid #d9e1ec;
}

    .outing-table thead th {
        background: #082f4f !important;
        color: white !important;
        font-weight: 700;
        text-align: center;
        vertical-align: middle;
        padding: 13px 10px;
        border-color: #214968;
        white-space: nowrap;
    }

    .outing-table tbody td {
        text-align: center;
        vertical-align: middle;
        padding: 12px 10px;
        border-color: #d9e1ec;
        white-space: nowrap;
    }

    .outing-table th:last-child,
    .outing-table td:last-child {
        min-width: 145px;
    }

    .outing-table th:nth-last-child(2),
    .outing-table td:nth-last-child(2) {
        min-width: 125px;
    }

/* ===== STATUS ===== */

.status-badge {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.status-out {
    background: #f8d7da;
    color: #b4232c;
}

.status-in {
    background: #d1e7dd;
    color: #157347;
}

.btn-return {
    white-space: nowrap;
    min-width: 110px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
    .quick-cards,
    .modules {
        grid-template-columns: repeat(2, 1fr);
    }

    .ttt-header-top {
        height: auto;
        min-height: 160px;
        padding: 22px;
    }

    .ttt-brand-logo {
        position: static;
        transform: none;
        margin-bottom: 12px;
    }

    .ttt-user-panel {
        position: static;
        transform: none;
        margin-top: 14px;
    }

    .ttt-header-menu-row {
        height: auto;
    }

    .ttt-menu-new {
        justify-content: center;
        flex-wrap: wrap;
        padding: 10px;
    }
}

@media (max-width: 700px) {
    .quick-cards,
    .modules {
        grid-template-columns: 1fr;
    }

    .ttt-main-new {
        padding: 22px 14px;
    }

    .outing-page {
        padding: 0 12px;
    }

    .outing-card {
        padding: 18px;
    }

    .outing-card-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}

/* ===== FIX OUTING LIST TABLE ===== */

.outing-card .table-responsive {
    overflow-x: visible !important;
}

.outing-table {
    min-width: unset !important;
    width: 100% !important;
    table-layout: fixed !important;
}

    .outing-table th,
    .outing-table td {
        white-space: normal !important;
        word-break: break-word;
        font-size: 12px;
        padding: 10px 6px !important;
    }

        .outing-table th:last-child,
        .outing-table td:last-child {
            width: 95px !important;
            min-width: 95px !important;
        }

        .outing-table th:nth-last-child(2),
        .outing-table td:nth-last-child(2) {
            width: 105px !important;
            min-width: 105px !important;
        }

    .outing-table .btn,
    .outing-table .btn-return {
        min-width: 76px !important;
        padding: 6px 8px !important;
        font-size: 12px !important;
    }

/* Hide empty validation summaries. Prevents blank red bars on initial GET pages. */
.validation-summary-valid,
.validation-summary-valid.alert,
.validation-summary-valid.alert-danger,
.alert.alert-danger:empty {
    display: none !important;
}

/* ===== Inventory UI consistency ===== */
.inventory-module-page .inventory-filter-card,
.inventory-filter-card {
    background: #f5f8fb !important;
    border: 1px solid #d8e2ec !important;
    border-right: 4px solid #0b4368 !important;
    box-shadow: none !important;
}
.inventory-filter-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-start; }
.inventory-module-page .btn,
.inventory-module-page .ttt-smart-grid-tools .btn,
.inventory-module-page .report-actions .btn,
.inventory-module-page button.btn {
    min-height: 38px !important;
    padding: 7px 14px !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    border-radius: 8px !important;
    min-width: auto !important;
}
.inventory-module-page .btn-sm,
.inventory-module-page .outing-table .btn-sm {
    min-height: 32px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
}
.inventory-module-page .ttt-smart-grid-tools { align-items:center; }
.inventory-module-page .ttt-smart-grid-tools .btn { flex:0 0 auto; }
@media print {
    .inventory-filter-card, .inventory-filter-actions, .ttt-page-actions { display:none !important; }
}

/* Inventory action buttons - scoped to inventory pages only. */
.inventory-module-page .inventory-action-btn {
    width: 68px;
    min-width: 68px;
    height: 30px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 2px;
}

.inventory-module-page form.d-inline > .inventory-action-btn {
    vertical-align: middle;
}

/* TTT global Rial amount formatting - display only; does not alter page layout */
.ttt-money-input {
    direction: ltr;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.ttt-money-display {
    direction: ltr;
    unicode-bidi: embed;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* Official-form print baseline. Dedicated A5 forms override this in their own views. */
@page { size: A4 portrait; margin: 10mm; }
@media print {
    body, .outing-page, .outing-card, .ttt-section-card, table, th, td, input, textarea, select {
        font-family: "B Mitra", "B Nazanin", Tahoma, Arial, sans-serif !important;
        font-size: 12pt !important;
    }
    h1, h2, h3, h4, h5, h6, strong, b, th, .ttt-page-title, .ttt-section-card-title {
        font-family: "B Mitra", "B Nazanin", Tahoma, Arial, sans-serif !important;
        font-size: 12pt !important;
        font-weight: 700 !important;
    }
}

/* Daily purchase definition column - 20261028 */
table.daily-request-lines {
    table-layout: auto !important;
    min-width: 950px !important;
}
table.daily-request-lines th:last-child,
table.daily-request-lines td:last-child {
    width: 340px !important;
    min-width: 340px !important;
    overflow: visible !important;
}
table.daily-request-lines th:nth-last-child(2),
table.daily-request-lines td:nth-last-child(2) {
    width: 180px !important;
    min-width: 180px !important;
}
table.daily-request-lines .daily-link-tools {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px;
    min-width: 300px;
}
table.daily-request-lines .daily-link-tools select {
    flex: 1 1 200px;
    min-width: 200px !important;
    width: auto !important;
    max-width: 100%;
}
table.daily-request-lines .daily-link-tools button {
    flex: 0 0 auto;
    white-space: nowrap !important;
}