body {
    background-color: #f7f9fb;
    font-family: 'Segoe UI', Roboto, sans-serif;
    transition: background 0.3s, color 0.3s;
}

header {
    background: linear-gradient(135deg, #0f766e 0%, #0f4c81 52%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(125, 211, 252, 0.2) 0%, rgba(125, 211, 252, 0) 68%);
    pointer-events: none;
}

header .container {
    position: relative;
    z-index: 1;
}

.app-brand {
    min-width: 0;
}

.app-logo {
    border-radius: 999px;
    border: 2px solid rgba(186, 230, 253, 0.8);
    box-shadow: 0 6px 20px rgba(2, 6, 23, 0.3);
}

.app-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: #f8fafc;
}

.app-subtitle {
    font-size: 0.78rem;
    color: rgba(226, 232, 240, 0.9);
    margin-top: 0.2rem;
    line-height: 1.3;
    max-width: 56ch;
}

.header-controls .btn {
    border-color: rgba(125, 211, 252, 0.6);
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.2);
    min-width: 2.2rem;
    min-height: 2.2rem;
}

.header-controls .btn:hover,
.header-controls .btn:focus {
    background: rgba(15, 23, 42, 0.45);
    border-color: #7dd3fc;
    color: #e0f2fe;
}

.header-controls .btn:focus-visible,
.workspace-tab:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 2px;
}

.navbar {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.navbar .nav-link.active {
    color: #fff !important;
    font-weight: 700;
}

.navbar .nav-link.active i {
    color: #8ec5ff;
}

.workspace-tabs {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding: 0.35rem;
    border-radius: 1.1rem;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    border: 1px solid #d8e3f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.workspace-tab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-width: 210px;
    min-height: 86px;
    padding: 0.75rem 0.95rem;
    border-radius: 0.95rem;
    border: 1px solid #d2deec;
    background: linear-gradient(145deg, #ffffff 0%, #eef3f9 100%);
    color: #1f2937;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    opacity: 0;
    animation: workspaceTabReveal 0.45s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.workspace-tab:nth-child(2) {
    animation-delay: 0.09s;
}

.workspace-tab:nth-child(3) {
    animation-delay: 0.18s;
}

.workspace-tab-head {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.workspace-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    font-size: 0.94rem;
}

.workspace-tab-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #0f172a;
}

.workspace-tab-desc {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.2;
    padding-left: 2.55rem;
}

.workspace-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    border-color: #9cc0e8;
    color: #0b3d63;
}

.workspace-tab.active {
    border-color: transparent;
    background: linear-gradient(135deg, #0f766e 0%, #0f4c81 52%, #0b2038 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(15, 76, 129, 0.28);
}

.workspace-tab.active:hover {
    transform: translateY(-1px);
}

.workspace-tab.active .workspace-tab-title,
.workspace-tab.active .workspace-tab-desc {
    color: #f8fafc;
}

.workspace-tab.active .workspace-tab-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #dbeafe;
}

.workspace-tab.active::after {
    content: "";
    position: absolute;
    top: -30%;
    left: -65%;
    width: 48%;
    height: 160%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 10%, rgba(255, 255, 255, 0.28) 48%, rgba(255, 255, 255, 0) 90%);
    transform: rotate(15deg);
    pointer-events: none;
    animation: workspaceActiveShine 1.05s ease-out 0.22s 1 both;
}

.workspace-tab--online .workspace-tab-icon {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.workspace-tab--local .workspace-tab-icon {
    background: rgba(14, 116, 144, 0.14);
    color: #155e75;
}

@keyframes workspaceTabReveal {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes workspaceActiveShine {
    from {
        left: -65%;
        opacity: 0;
    }

    18% {
        opacity: 1;
    }

    to {
        left: 125%;
        opacity: 0;
    }
}

.content-wrapper {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 2rem;
}

.modal-content,
.app-modal {
    border: 1px solid #d8e3f0;
    border-radius: 1rem;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.modal-header:not([class*="bg-"]),
.app-modal .modal-header {
    border-bottom: 1px solid #d8e3f0;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.modal-title,
.app-modal .modal-title {
    color: #0f4c81;
    font-weight: 700;
}

.modal-footer,
.app-modal .modal-footer {
    border-top: 1px solid #d8e3f0;
    background: #f8fbff;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.modal-footer .btn {
    min-height: 2.35rem;
    padding: 0.42rem 1rem;
    border-radius: 0.65rem;
    font-weight: 600;
}

.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary {
    min-width: 112px;
}

.modal-footer .btn-primary,
.modal-footer .btn-success,
.modal-footer .btn-danger,
.modal-footer .btn-warning {
    min-width: 132px;
}

.modal-body,
.app-modal .modal-body {
    background: #ffffff;
}

.modal-backdrop.show {
    opacity: 0.58;
}

.modal .btn-close {
    filter: saturate(0.9);
}

footer {
    background: #212529;
    color: #ccc;
    font-size: 0.9rem;
}

footer a {
    color: #ffc107;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.bi {
    vertical-align: -0.125em;
}

.logout-inline-form {
    display: inline;
}

.logout-inline-button {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.dark-mode {
    background-color: #121212 !important;
    color: #e2e2e2 !important;
}

.dark-mode .content-wrapper {
    background-color: #1e1e1e !important;
    color: #e2e2e2;
}

.dark-mode .navbar,
.dark-mode header {
    background: linear-gradient(135deg, #0b3a36 0%, #0f2d4a 52%, #020617 100%) !important;
}

.dark-mode header::before {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, rgba(56, 189, 248, 0) 68%);
}

.dark-mode .app-logo {
    border-color: rgba(125, 211, 252, 0.75);
}

.dark-mode .app-subtitle {
    color: rgba(203, 213, 225, 0.92);
}

.dark-mode .workspace-tab {
    border-color: #334155;
    background: linear-gradient(150deg, #1f2937 0%, #17212f 100%);
    color: #e5e7eb;
}

.dark-mode .workspace-tab:hover {
    background: linear-gradient(150deg, #253247 0%, #1f2f46 100%);
    border-color: #3b82f6;
    color: #bfdbfe;
}

.dark-mode .workspace-tab.active {
    background: linear-gradient(135deg, #0f766e 0%, #155e75 45%, #1d4ed8 100%);
    color: #fff;
}

.dark-mode .workspace-tabs {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    border-color: #1f2937;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.5);
}

.dark-mode .workspace-tab-title {
    color: #e2e8f0;
}

.dark-mode .workspace-tab-desc {
    color: #94a3b8;
}

.dark-mode .workspace-tab-icon {
    background: rgba(94, 234, 212, 0.12);
    color: #67e8f9;
}

.dark-mode .modal-content,
.dark-mode .app-modal {
    border-color: #334155;
    box-shadow: 0 20px 42px rgba(2, 6, 23, 0.6);
}

.dark-mode .modal-header:not([class*="bg-"]),
.dark-mode .app-modal .modal-header,
.dark-mode .modal-footer,
.dark-mode .app-modal .modal-footer {
    border-color: #334155;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.dark-mode .modal-body,
.dark-mode .app-modal .modal-body {
    background: #0f172a;
}

.dark-mode .modal-title,
.dark-mode .app-modal .modal-title {
    color: #7dd3fc;
}

.dark-mode .modal .btn-close {
    filter: invert(1) grayscale(0.2);
}

.dark-mode .modal-footer .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #64748b;
}

.dark-mode .modal-footer .btn-outline-secondary:hover {
    color: #0f172a;
    background: #cbd5e1;
    border-color: #cbd5e1;
}

@media (min-width: 992px) {
    .workspace-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }

    .workspace-tab {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .workspace-tab {
        animation: none;
        opacity: 1;
    }

    .workspace-tab.active::after {
        animation: none;
        display: none;
    }
}

.dark-mode footer {
    background: #0f0f0f;
}

.dark-mode .text-muted {
    color: #adb5bd !important;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
    color: #f8f9fa !important;
}

.dark-mode .card {
    background-color: #212529 !important;
    color: #e2e2e2 !important;
    border-color: #343a40 !important;
}

.dark-mode .table {
    background-color: #1e1e1e !important;
    color: #e2e2e2;
}

.dark-mode .table td,
.dark-mode .table th {
    background-color: #1e1e1e !important;
    border-color: #343a40 !important;
    color: #e2e2e2 !important;
}

.dark-mode .table-hover tbody tr:hover,
.dark-mode .table-hover tbody tr:hover td {
    background-color: #2a2a2a !important;
}

.dark-mode .table-light {
    background-color: #2c3034 !important;
    color: #e2e2e2 !important;
}

.dark-mode .table-light th,
.dark-mode .table-light td {
    background-color: #2c3034 !important;
    color: #e2e2e2 !important;
}

.dark-mode .bg-light {
    background-color: #2b3035 !important;
    color: #e2e2e2 !important;
    border-color: #495057 !important;
}

.dark-mode .list-group-item {
    background-color: #212529 !important;
    color: #e2e2e2 !important;
    border-color: #343a40 !important;
}

.dark-mode .alert-light {
    background-color: #2b3035 !important;
    color: #e2e2e2 !important;
    border-color: #495057 !important;
}

.dark-mode .btn-outline-secondary {
    border-color: #6c757d;
    color: #cbd5e0;
}

.dark-mode .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.status-solucionado,
.badge-solucionado {
    background-color: #0d6efd;
    color: #fff;
}

.status-enproceso {
    background-color: #f59e0b;
    color: #1f1f1f;
}

.status-esperando {
    background-color: #ffeb3b;
    color: #1f1f1f;
}

.status-sinsolucion {
    background-color: #dc3545;
    color: #fff;
}

.status-entregado {
    background-color: #198754;
    color: #fff;
}

.status-garantia {
    background-color: #0f766e;
    color: #fff;
}

.dark-mode .btn-edit {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #1f1f1f !important;
}

.dark-mode .btn-edit:hover {
    background-color: #e0a800 !important;
    border-color: #e0a800 !important;
    color: #1f1f1f !important;
}

.dark-mode .form-control,
.dark-mode .form-select {
    background-color: #1e1e1e !important;
    border-color: #343a40 !important;
    color: #e2e2e2 !important;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
    background-color: #1e1e1e !important;
    border-color: #5b9cff !important;
    color: #f8f9fa !important;
    box-shadow: 0 0 0 0.2rem rgba(91, 156, 255, 0.25) !important;
}

.dark-mode .form-control::placeholder {
    color: #9aa0a6 !important;
}

.status-dropdown-toggle {
    cursor: pointer;
}

.dark-mode .input-group-text {
    background-color: #2a2a2a !important;
    border-color: #343a40 !important;
    color: #e2e2e2 !important;
}

@media (max-width: 576px) {
    .app-title {
        font-size: 0.95rem;
    }

    .app-subtitle {
        display: none;
    }

    .app-logo {
        width: 40px;
        height: 40px;
    }

    .workspace-tabs {
        gap: 0.5rem;
        padding: 0.3rem;
    }

    .workspace-tab {
        min-width: 100%;
        padding: 0.68rem 0.8rem;
        min-height: 74px;
    }

    .workspace-tab-title {
        font-size: 0.9rem;
    }

    .workspace-tab-desc {
        font-size: 0.7rem;
        padding-left: 2.35rem;
    }

    .workspace-tab {
        width: 100%;
        justify-content: center;
    }

    .header-controls .btn {
        min-width: 2rem;
        min-height: 2rem;
    }

    .modal-footer {
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        width: 100%;
        min-width: 0;
    }
}