/* ============================================
   TMS Track Consignment — Professional theme
   ============================================ */

:root {
    --tms-primary: #1e3a5f;
    --tms-primary-light: #2c5282;
    --tms-primary-dark: #0f2744;
    --tms-accent: #3182ce;
    --tms-bg: #f5f7fa;
    --tms-card-bg: #ffffff;
    --tms-border: #e2e8f0;
    --tms-text: #1a202c;
    --tms-text-muted: #718096;
    --tms-header-bg: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    --tms-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --tms-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
    --tms-radius: 8px;
    --tms-radius-lg: 12px;
}

/* Base */
.tms-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--tms-text);
    background-color: var(--tms-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.tms-header {
    background: var(--tms-header-bg);
    color: #fff;
    padding: 1.5rem 0;
    box-shadow: var(--tms-shadow-lg);
}

.tms-header-inner {
    max-width: 100%;
}

.tms-logo {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tms-tagline {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main content */
.tms-main {
    flex: 1;
    padding: 2rem 0 3rem;
}

/* Cards */
.tms-card,
.tms-table-card {
    background: var(--tms-card-bg);
    border-radius: var(--tms-radius-lg);
    box-shadow: var(--tms-shadow);
    border: 1px solid var(--tms-border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.tms-search-card {
    margin-bottom: 2rem;
}

.tms-company-label {
    color: var(--tms-primary);
    font-weight: 600;
    font-size: 1rem;
}

.tms-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--tms-border);
    background: #fafbfc;
}

.tms-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tms-primary-dark);
}

.tms-card-body {
    padding: 1.5rem;
}

/* Form */
.tms-label {
    font-weight: 500;
    color: var(--tms-text);
    margin-bottom: 0.35rem;
}

.form-control-tms,
.form-select-tms {
    border: 1px solid var(--tms-border);
    border-radius: var(--tms-radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.form-control-tms:focus,
.form-select-tms:focus {
    border-color: var(--tms-accent);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
    outline: 0;
}

.btn-tms-primary {
    background: var(--tms-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: var(--tms-radius);
    transition: background 0.2s ease, transform 0.05s ease;
}

.btn-tms-primary:hover {
    background: var(--tms-primary-light);
    color: #fff;
}

.btn-tms-primary:active {
    transform: scale(0.98);
}

/* Results section */
.tms-results {
    margin-top: 0.5rem;
}

/* Data tables */
.table-tms {
    margin: 0;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-tms thead th {
    background: var(--tms-primary);
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.85rem 1rem;
    border: none;
    white-space: nowrap;
}

.table-tms tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tms-border);
    vertical-align: middle;
}

/* Consignment Movement row types */
.table-tms tbody tr.tms-movement-pickup {
    background-color: #e8f4fd;
    border-left: 4px solid #3182ce;
}
.table-tms tbody tr.tms-movement-moved {
    background-color: #fef9e7;
    border-left: 4px solid #d69e2e;
}
.table-tms tbody tr.tms-movement-reached {
    background-color: #f0fff4;
    border-left: 4px solid #38a169;
}
.table-tms tbody tr.tms-movement-delivered {
    background-color: #e6fffa;
    border-left: 4px solid #319795;
    font-weight: 600;
}

.table-tms tbody tr:hover {
    background-color: #f8fafc;
}

.table-tms tbody tr:last-child td {
    border-bottom: none;
}

.table-tms .empty-row td,
.table-tms > tbody > tr.empty-data > td {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--tms-text-muted);
    font-style: italic;
}

/* GridView empty state (ASP.NET renders empty data row) */
.table-responsive .table-tms + table,
.table-tms Table {
    margin: 0;
}

/* Footer */
.tms-footer {
    padding: 1rem 0;
    background: var(--tms-primary-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    text-align: center;
}

.tms-footer-text {
    margin: 0;
}

/* Utility: ensure container doesn't over-stretch on large screens */
.tms-main .container {
    max-width: 1140px;
}

/* Responsive */
@media (max-width: 768px) {
    .tms-header {
        padding: 1.25rem 0;
    }

    .tms-logo {
        font-size: 1.5rem;
    }

    .tms-tagline {
        font-size: 0.875rem;
    }

    .tms-main {
        padding: 1.5rem 0 2rem;
    }

    .tms-card-body {
        padding: 1rem;
    }

    .table-tms thead th,
    .table-tms tbody td {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Legacy: keep existing layout rules for other pages */
.body-content {
    margin-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
}

input:not([class*="form-control"]),
select:not([class*="form-select"]),
textarea {
    max-width: 280px;
}

@media screen and (min-width: 768px) {
    .body-content {
        padding: 0;
    }
}
