/* Dashboard Container */
.dashboard-container {
    padding: 20px;
    width: 100%;
    position: relative;
}

/* Department Toolbar */
.department-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.department-label {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Custom Department MultiSelect */
.dept-multiselect {
    position: relative;
    min-width: 350px;
    flex: 1;
    max-width: 600px;
}

.dept-input-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 32px 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.dept-input-area:hover {
    border-color: #999;
}

.dept-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.8rem;
    pointer-events: none;
}

.dept-placeholder {
    color: #999;
    font-size: 0.9rem;
}

.dept-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #e8f0fe;
    border: 1px solid #c4d7f2;
    border-radius: 14px;
    font-size: 0.85rem;
    color: #1a3d6f;
    white-space: nowrap;
}

.dept-chip-remove {
    background: none;
    border: none;
    color: #1a3d6f;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: 0.7;
}

.dept-chip-remove:hover {
    opacity: 1;
}

.dept-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.dept-search {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #eee;
    outline: none;
    font-size: 0.9rem;
    border-radius: 6px 6px 0 0;
}

.dept-options {
    overflow-y: auto;
    max-height: 240px;
}

.dept-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    margin: 0;
}

.dept-option:hover {
    background: #f0f4ff;
}

.dept-option-selected {
    background: #e8f0fe;
}

.dept-option input[type="checkbox"] {
    accent-color: #3f80ea;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dept-no-results {
    padding: 12px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Metric Tiles */
.metric-tile {
    border-radius: 14px;
    padding: 28px 24px;
    border: 1px solid #e0e4e8;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.metric-tile-success {
    background: linear-gradient(135deg, #ffffff 0%, #e8f5ee 100%);
}

.metric-tile-danger {
    background: linear-gradient(135deg, #ffffff 0%, #fdeaea 100%);
}

.metric-tile-primary {
    background: linear-gradient(135deg, #ffffff 0%, #e6eff7 100%);
}

.metric-content {
    text-align: center;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.metric-tile-success .metric-value {
    color: #2d6a4f;
}

.metric-tile-danger .metric-value {
    color: #c0392b;
}

.metric-tile-primary .metric-value {
    color: #2c5f7c;
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-transform: uppercase;
    border: 1px solid;
}

.status-badge svg {
    flex-shrink: 0;
}

.status-badge-open {
    background-color: #fdf0ec;
    color: #a3522e;
    border-color: #f0cdc0;
}

.status-badge-inprocess {
    background-color: #edf3f9;
    color: #3d6588;
    border-color: #c4d8ea;
}

.status-badge-complete {
    background-color: #eef6f1;
    color: #3d7a52;
    border-color: #c2dfcc;
}

.status-badge-closed {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #dde0e4;
}

/* Splitter Pane Scrolling */
.order-list-container {
    height: 100%;
    overflow-y: auto;
    padding: 12px;
}

.order-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    text-align: center;
    padding: 20px;
}

.order-list-empty h3 {
    margin-bottom: 8px;
    color: #333;
}

/* Order Cards */
.list-card-wrapper {
    margin-bottom: 12px;
    cursor: pointer;
}

.list-card-selected .list-card {
    border: 2px solid #7c9cbf;
    box-shadow: 0 4px 12px rgba(124, 156, 191, 0.25);
}

.list-card-selected .list-card-indicator {
    background: #7c9cbf;
    width: 5px;
}

.list-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 2px solid transparent;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.list-card-number {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.list-card-body {
    padding: 16px;
}

.list-info-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.list-info-row:last-child {
    margin-bottom: 0;
}

.list-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    flex-shrink: 0;
}

.list-icon-user {
    background: #8b95a5;
}

.list-icon-date {
    background: #7ba3b5;
}

.list-icon-type {
    background: #bda87e;
}

.list-info-content {
    flex: 1;
    min-width: 0;
}

.list-info-value {
    font-size: 0.95rem;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
}

/* Order Detail */
.order-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
    text-align: center;
    padding: 20px;
}

.order-details {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.order-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.order-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-number-badge {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

/* View Details Navigation Button */
.order-detail-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 2px solid #4a6e84;
    border-radius: 50%;
    background: white;
    color: #4a6e84;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.order-detail-nav-btn:hover {
    background: #4a6e84;
    color: white;
    transform: scale(1.08);
}

.order-detail-nav-btn:active {
    transform: scale(1);
}

.order-body {
    padding: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon-blue {
    background: #7c9cbf;
}

.info-icon-orange {
    background: #c4977e;
}

.info-content {
    min-width: 0;
}

.info-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detail-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    background: #fff;
}

.detail-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #edf0f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
}

.detail-content {
    min-width: 0;
}

.detail-label {
    font-size: 0.75rem;
    color: #7c8a9a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 0.95rem;
    color: #333;
}

.location-link {
    color: #7c9cbf;
    text-decoration: none;
}

.location-link:hover {
    text-decoration: underline;
}

.order-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn-teal {
    background: linear-gradient(135deg, #4a6e84, #567e96);
}

.action-btn-dark {
    background: linear-gradient(135deg, #3e4756, #535e70);
}

.action-btn-green {
    background: linear-gradient(135deg, #4a7e64, #559072);
}

/* Modal/Dialog Styling */
.dialog-content {
    padding: 4px;
}

.dialog-form-group {
    margin-bottom: 20px;
}

.dialog-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.dialog-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.dialog-textarea:focus {
    outline: none;
    border-color: #7c9cbf;
    box-shadow: 0 0 0 3px rgba(124, 156, 191, 0.15);
}

.dialog-textarea::placeholder {
    color: #999;
}

/* Modal Footer (used in dialog components) */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #dee2e6;
}

.modal-footer .k-button {
    min-width: 100px;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
}

/* Form Styling */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 2rem;
    }

    .department-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .order-actions {
        flex-direction: column;
    }

    /* Dialog mobile styles */
    .k-window {
        max-width: calc(100vw - 20px) !important;
        min-width: auto !important;
        margin: 10px !important;
    }

    .k-window-content {
        padding: 16px !important;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .k-button {
        width: 100%;
        justify-content: center;
    }

    .dialog-textarea {
        min-height: 100px;
    }
}

/* Skeleton Loaders */
.skeleton-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-line-short {
    width: 40%;
}

.skeleton-line-medium {
    width: 70%;
}

.skeleton-line-full {
    width: 100%;
}

.skeleton-line-heading {
    height: 20px;
    width: 30%;
    margin-bottom: 16px;
}

.skeleton-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.skeleton-tile {
    height: 100px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-wave 1.5s infinite;
    border-radius: 8px;
}

.skeleton-detail-block {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes skeleton-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Accessibility */
[aria-busy="true"] {
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Dashboard Notification Styling */
.dashboard-notification {
    z-index: 10000 !important;
}

.dashboard-notification .k-notification-group {
    top: 80px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
}

.dashboard-notification .k-notification {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: notification-slide-in 0.3s ease-out;
}

.dashboard-notification .k-notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
}

.dashboard-notification .k-notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
}

.dashboard-notification .k-notification-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
}

.dashboard-notification .k-notification-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
}

.dashboard-notification .k-notification .k-icon {
    font-size: 1.5rem;
}

.dashboard-notification .k-notification-close-action {
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.dashboard-notification .k-notification-close-action:hover {
    opacity: 1;
}

@keyframes notification-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Service Order Maintenance Page
   ============================================================ */

.so-maintenance-container {
    padding: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Card */
.so-header-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px 28px;
    margin-bottom: 20px;
    border-left: 5px solid #4a6e84;
}

.so-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.so-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.so-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid #ccc;
    border-radius: 10px;
    background: white;
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.so-back-btn:hover {
    border-color: #4a6e84;
    color: #4a6e84;
    transform: translateY(-1px);
}

.so-back-btn:active {
    transform: translateY(0);
}

.so-order-type {
    color: #333;
}

.so-order-number-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: #4a6e84;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
}

/* Content Grid: Details + Quick Actions side by side */
.so-content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 20px;
}

/* Shared Card Style */
.so-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

/* Detail Table */
.so-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.so-detail-table tr {
    border-bottom: 1px solid #eee;
}

.so-detail-table tr:last-child {
    border-bottom: none;
}

.so-detail-table td {
    padding: 14px 16px;
    vertical-align: top;
}

.so-detail-label {
    font-weight: 600;
    color: #4a6e84;
    width: 160px;
    background: #f0f5f8;
    white-space: nowrap;
}

.so-detail-value {
    color: #333;
}

/* Comment Textarea */
.so-comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.so-comment-textarea:focus {
    outline: none;
    border-color: #7c9cbf;
    box-shadow: 0 0 0 3px rgba(124, 156, 191, 0.15);
    background: #fff;
}

/* Quick Actions */
.so-quick-actions {
    display: flex;
    flex-direction: column;
}

.so-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
}

.so-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.so-action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4a6e84, #567e96);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-align: center;
}

.so-action-tile:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.so-action-tile:active {
    transform: translateY(0);
}

/* Service Items Grid Section */
.so-grid-section {
    margin-top: 0;
}

.so-grid-instructions {
    font-size: 0.95rem;
    color: #333;
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: #f0f5f8;
    border-left: 4px solid #4a6e84;
    border-radius: 4px;
    font-weight: 500;
}

/* Edit link in grid */
.so-edit-link {
    display: inline-flex;
    align-items: center;
    color: #4a6e84;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.so-edit-link:hover {
    color: #3d5a6e;
    text-decoration: underline;
}

/* Telerik Grid Overrides */
.so-service-grid {
    border-radius: 8px;
    overflow: hidden;
}

.so-service-grid .k-grid-header {
    background: #f8f9fa;
}

.so-service-grid .k-grid-header th {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    text-transform: none;
    border-bottom: 2px solid #dee2e6;
}

.so-service-grid .k-grid-content tr:hover {
    background: #f0f5f8;
}

.so-service-grid .k-grid-content td {
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #333;
}

/* Form Input (Edit Dialog) */
.so-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.so-form-input:focus {
    outline: none;
    border-color: #7c9cbf;
    box-shadow: 0 0 0 3px rgba(124, 156, 191, 0.15);
}

.so-form-input:disabled {
    background: #f5f5f5;
    color: #666;
}

.so-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* Empty State */
.so-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.so-empty-state h3 {
    color: #333;
    margin-bottom: 8px;
}

.so-empty-state p {
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .so-content-grid {
        grid-template-columns: 1fr;
    }

    .so-actions-grid {
        grid-template-columns: 1fr 1fr;
    }

    .so-form-row {
        grid-template-columns: 1fr;
    }

    .so-detail-label {
        width: 120px;
    }
}

@media (max-width: 600px) {
    .so-maintenance-container {
        padding: 10px;
    }

    .so-header-title {
        font-size: 1.2rem;
    }

    .so-actions-grid {
        grid-template-columns: 1fr 1fr;
    }
}

