/* ============================================================
   Dealer CMS Styles
   Shared across all /account/ pages
   ============================================================ */

/* ---- Sidebar Navigation ---- */
.cms-sidebar {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.cms-sidebar .profile-picture {
    text-align: center;
    margin-bottom: 15px;
}

.cms-sidebar .profile-picture img {
    border-radius: 8px;
}

.cms-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.cms-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.cms-nav-item:hover {
    background: #fefce8;
    color: #ee8d00;
    text-decoration: none;
}
.cms-nav-item.active {
    background: #f4da70;
    color: #333;
    font-weight: 600;
}

.cms-nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.cms-nav-badge {
    margin-left: auto;
    background: #ee8d00;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.cms-nav-logout {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 14px;
    color: #999;
    font-size: 14px;
}
.cms-nav-logout:hover {
    color: #c62828;
    background: #fbe9e7;
}

/* ---- Profile sub-nav tabs ---- */
.profile-sub-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 0;
}
.profile-section-tabs {
    display: flex;
    gap: 8px;
}
.cms-tab-btn {
    background: #f4da70;
    border-radius: 8px;
    padding: 5px 12px;
    box-shadow: 3px 3px 5px 0 orange;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.cms-tab-btn:hover {
    box-shadow: 2px 2px 3px 0 darkorange;
    text-decoration: none;
    color: #333;
}

/* ---- Page Header ---- */
.cms-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f4da70;
}

.cms-page-header h2 {
    margin: 0;
    font-size: 24px;
}

/* ---- Buttons ---- */
.cms-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: box-shadow 0.15s, background 0.15s;
}
.cms-btn-primary {
    background: #f4da70;
    color: #333;
    box-shadow: 3px 3px 5px 0 orange;
}
.cms-btn-primary:hover {
    box-shadow: 2px 2px 3px 0 darkorange;
    text-decoration: none;
    color: #333;
}
.cms-btn-primary:active {
    background: darkorange;
}
.cms-btn-danger {
    background: #fbe9e7;
    color: #c62828;
}
.cms-btn-danger:hover {
    background: #ef9a9a;
    color: #fff;
}
.cms-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}
.cms-btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
}
.cms-btn-outline:hover {
    border-color: #ee8d00;
    color: #ee8d00;
}

/* ---- Data Table ---- */
.cms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.cms-table thead th {
    background: #f4da70;
    color: #333;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ee8d00;
}
.cms-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.cms-table tbody tr:hover {
    background: #fefce8;
}
.cms-table .actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
}

/* ---- Search/Filter Bar ---- */
.cms-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}
.cms-toolbar input[type="text"],
.cms-toolbar select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.cms-toolbar input[type="text"]:focus,
.cms-toolbar select:focus {
    border-color: #f4da70;
    box-shadow: 0 0 0 2px rgba(244,218,112,0.3);
}
.cms-toolbar input[type="text"] {
    flex: 1;
    min-width: 180px;
}

/* ---- Forms ---- */
.cms-form {
    max-width: 700px;
}
.cms-form-group {
    margin-bottom: 18px;
}
.cms-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}
.cms-form-group input[type="text"],
.cms-form-group input[type="email"],
.cms-form-group input[type="tel"],
.cms-form-group input[type="number"],
.cms-form-group input[type="url"],
.cms-form-group select,
.cms-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.cms-form-group input:focus,
.cms-form-group select:focus,
.cms-form-group textarea:focus {
    border-color: #f4da70;
    box-shadow: 0 0 0 2px rgba(244,218,112,0.3);
}
.cms-form-group textarea {
    min-height: 120px;
    resize: vertical;
}
.cms-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.cms-form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* ---- Status Messages ---- */
.cms-alert {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 14px;
}
.cms-alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}
.cms-alert-error {
    background: #fbe9e7;
    color: #c62828;
}
.cms-alert-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ---- Cards ---- */
.cms-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.cms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.cms-card-header h3 {
    margin: 0;
    font-size: 18px;
}

/* ---- Delivery Route Builder ---- */
.route-builder {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    min-height: 500px;
}
.route-stop-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
}
.route-stop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background: #fff;
    cursor: grab;
    transition: background 0.1s;
}
.route-stop-item:hover {
    background: #fefce8;
}
.route-stop-item.dragging {
    opacity: 0.5;
    background: #f4da70;
}
.route-stop-number {
    width: 28px;
    height: 28px;
    background: #ee8d00;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.route-stop-info {
    flex: 1;
    min-width: 0;
}
.route-stop-name {
    font-weight: 600;
    font-size: 14px;
}
.route-stop-addr {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.route-stop-qty {
    width: 50px;
    padding: 4px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.route-stop-remove {
    color: #c62828;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    border: none;
    background: none;
}
.route-stop-remove:hover {
    color: #f44336;
}

#route-map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.available-customers-panel {
    margin-top: 15px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #eee;
}
.available-customers-panel h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
}
.avail-customer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}
.avail-customer-item:last-child {
    border-bottom: none;
}

/* ---- Message Compose ---- */
.compose-form textarea {
    min-height: 200px;
}

.template-selector {
    margin-bottom: 15px;
}

.sent-message-preview {
    max-height: 100px;
    overflow: hidden;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* ---- Message Tabs ---- */
.cms-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f4da70;
    margin-bottom: 20px;
}
.cms-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s;
}
.cms-tab:hover {
    color: #ee8d00;
    text-decoration: none;
}
.cms-tab.active {
    color: #333;
    border-bottom-color: #ee8d00;
    font-weight: 600;
}

/* ---- Empty State ---- */
.cms-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}
.cms-empty p {
    margin-bottom: 15px;
}

/* ---- Today's Deliveries Summary ---- */
.today-summary {
    background: linear-gradient(135deg, #fefce8 0%, #fff3e0 100%);
    border: 1px solid #f4da70;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}
.today-summary h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #ee8d00;
}

/* ---- Print styles for delivery manifest ---- */
@media print {
    .cms-sidebar, .main_menu_area, .mobile_logo_area,
    .footer_area, .copyright_area, .cms-toolbar,
    .cms-page-header .cms-btn, .route-builder #route-map,
    .no-print { display: none !important; }
    .route-stop-list { max-height: none; overflow: visible; }
    .cms-table { font-size: 12px; }
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .route-builder {
        grid-template-columns: 1fr;
    }
    #route-map {
        height: 350px;
    }
    .cms-form-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 576px) {
    .cms-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .cms-toolbar {
        flex-direction: column;
    }
    .cms-table {
        font-size: 12px;
    }
    .cms-table thead th,
    .cms-table tbody td {
        padding: 6px 8px;
    }
    .profile-sub-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}
