/* ==========================================================================
   Courier & Cargo Franchise ERP - Primary Application Stylesheet
   Theme: Authentic Ochre / Warm Caramel (#c27d2c, #9e601c)
   Reference: app.ctrunk.com (48 UI Screenshots)
   ========================================================================== */

:root {
    /* Brand Theme */
    --color-primary: #c27d2c;
    --color-primary-dark: #9e601c;
    --color-primary-light: #e59d48;
    --color-primary-subtle: #fcf7f1;
    --color-primary-hover: #b06f23;

    /* Interface Neutrals */
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-border-input: #cbd5e1;
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;

    /* Semantic Status */
    --color-success: #28a745;
    --color-success-dark: #218838;
    --color-danger: #dc3545;
    --color-warning: #f39c12;
    --color-info: #17a2b8;

    /* Carrier Brand Colors */
    --badge-nandan: #e91e63;
    --badge-indiapost: #c2185b;
    --badge-dtdc: #1e88e5;
    --badge-bluedart: #00897b;
    --badge-mahavir: #8e24aa;
    --badge-maruti: #f57c00;
    --badge-trackon: #7b1fa2;
    --badge-default: #546e7a;

    /* Typography & Spacing */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--color-text-main);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Top Navigation Bar (52px Ochre Bar) */
.navbar {
    height: 52px;
    background-color: var(--color-primary);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 0 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-nav {
    display: flex;
    align-items: stretch;
    list-style: none;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-link:hover, .nav-item.active .nav-link {
    background-color: var(--color-primary-dark);
    text-decoration: none;
}

.nav-item:first-child .nav-link {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    padding: 4px 0;
    z-index: 1050;
    animation: fadeIn 0.15s ease-in-out;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: var(--color-text-main);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    text-transform: none;
}

.dropdown-item:hover {
    background-color: var(--color-primary-subtle);
    color: var(--color-primary-dark);
    text-decoration: none;
    padding-left: 20px;
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 4px 0;
}

/* User Profile Badge in Nav */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-weight: 700;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.12);
    font-size: 13px;
}

/* Main Workspace Container */
.container-fluid {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px 20px;
}

/* Dual Pane Layout (60% Form / 40% Recent Bookings Stream) */
.dual-pane-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.pane-form {
    flex: 0 0 60%;
    max-width: 60%;
}

.pane-stream {
    flex: 0 0 40%;
    max-width: 40%;
}

@media (max-width: 1100px) {
    .dual-pane-layout {
        flex-direction: column;
    }
    .pane-form, .pane-stream {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Cards & Surfaces */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}

.card-body {
    padding: 16px;
}

/* Form Styling with Screenshot Details */
.form-group {
    margin-bottom: 12px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--color-text-main);
    background-color: #ffffff;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(194, 125, 44, 0.2);
}

/* Red Left-Border Accent for Mandatory Fields (Screenshots 103, 108) */
.form-control.req-accent, .req-accent {
    border-left: 3.5px solid #e53e3e !important;
}

/* Form Row Grids */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.col-12 { flex: 0 0 100%; width: 100%; }
.col-8 { flex: 0 0 66.666%; width: 66.666%; }
.col-6 { flex: 0 0 50%; width: 50%; }
.col-4 { flex: 0 0 33.333%; width: 33.333%; }
.col-3 { flex: 0 0 25%; width: 25%; }
.col-2 { flex: 0 0 16.666%; width: 16.666%; }

/* Input with Inline Buttons / Addons */
.input-group {
    display: flex;
    position: relative;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-addon-btn {
    height: 38px;
    padding: 0 12px;
    background: #e2e8f0;
    border: 1px solid var(--color-border-input);
    border-left: none;
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    color: var(--color-text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.input-group-addon-btn:hover {
    background: #cbd5e1;
}

/* Autocomplete Dropdown List */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--color-border-input);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background-color: var(--color-primary-subtle);
    color: var(--color-primary-dark);
}

.autocomplete-item strong {
    color: #1e40af;
}

/* Sticky Remember Checkbox Bar (Screenshot 114) */
.remember-bar {
    background-color: #f8fafc;
    border: 1px dashed var(--color-border-input);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 12.5px;
    font-weight: 600;
}

.remember-title {
    color: var(--color-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Financial Readouts / Net Amount Box */
.calc-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
}

.net-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    margin-top: 6px;
    border-top: 1px solid #e2e8f0;
}

.net-amount-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-danger);
}

.net-amount-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-danger);
    font-family: var(--font-mono);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary-dark);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background-color: #64748b;
    border-color: #475569;
    color: #ffffff;
}
.btn-secondary:hover {
    background-color: #475569;
    color: #ffffff;
}

.btn-success {
    background-color: var(--color-success);
    border-color: var(--color-success-dark);
    color: #ffffff;
}
.btn-success:hover {
    background-color: var(--color-success-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-border-input);
    color: var(--color-text-main);
}
.btn-outline:hover {
    background: #f1f5f9;
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* Form Action Buttons Bar */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

/* Recent Bookings Stream Cards (Screenshots 103, 108) */
.stream-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.booking-stream-list {
    max-height: 640px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.stream-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stream-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* Carrier Initial Circular Avatar */
.carrier-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-nandan { background-color: var(--badge-nandan); }
.avatar-post { background-color: var(--badge-indiapost); }
.avatar-dtdc { background-color: var(--badge-dtdc); }
.avatar-bluedart { background-color: var(--badge-bluedart); }
.avatar-maruti { background-color: var(--badge-maruti); }
.avatar-default { background-color: var(--badge-default); }

.stream-card-body {
    flex: 1;
    min-width: 0;
}

.stream-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e40af; /* Bold navy for client name */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.stream-card-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.stream-card-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--color-text-main);
    font-weight: 600;
}

.stream-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.docket-badge {
    background: #f1f5f9;
    color: #334155;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}

.stream-action-btns {
    display: flex;
    gap: 4px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    border-radius: 3px;
    transition: all 0.15s;
}

.icon-btn:hover {
    color: var(--color-danger);
    background: #fee2e2;
}

.icon-btn.print-btn:hover {
    color: var(--color-primary-dark);
    background: var(--color-primary-subtle);
}

/* Floating Action Buttons (FAB - Bottom Right) */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}

.fab-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.2s, background-color 0.2s;
}

.fab-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background-color: var(--color-primary-dark);
}

/* Modal Dialog Styles (Screenshot 107 Volumetric, UPI QR, Bill item toggles) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 650px;
    width: 100%;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

.modal-header {
    background: var(--color-primary);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.modal-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Volumetric 3D Cardboard Box Graphic */
.volumetric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.box-illustration-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px dashed var(--color-border-input);
    border-radius: var(--radius-md);
    padding: 20px;
}

.box-svg {
    width: 180px;
    height: 140px;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

.table th {
    background: #f8fafc;
    color: var(--color-text-main);
    font-weight: 700;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
    font-size: 12px;
    text-transform: uppercase;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.table tr:hover {
    background-color: #fbfbfb;
}

/* Stats Metric Cards (Dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-primary-subtle);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Stock Warning Badge */
.stock-badge-zero {
    color: #dc3545;
    font-weight: 800;
}

/* SVG Barcode Preview Container */
.barcode-svg-container {
    display: inline-block;
    padding: 4px;
    background: #fff;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
