:root {
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
    --success: #22c55e;
    --info: #3b82f6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --glass: rgba(30, 41, 59, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

h1,
h2,
h3,
.logo-text {
    font-family: 'Outfit', sans-serif;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: 100vh;
    transition: transform 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    /* Allow wrapping if dot is too much */
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 2000;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        left: 0;
    }
}

.logo-icon {
    background: var(--primary);
    padding: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-input);
    color: var(--text);
}

.nav-item.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Main Content */
.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.page {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.title-group h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.title-group p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-val {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Outfit';
    transition: color 0.3s;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.bar-label {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.input-group.full {
    grid-column: 1 / -1;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.file-upload {
    border: 2px dashed var(--border);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(245, 158, 11, 0.05);
}

.btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Averia Cards */
.feed {
    display: grid;
    gap: 1.5rem;
}

.averia-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.priority-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.prio-alta {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.prio-media {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.prio-baja {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
}

.status-pendiente {
    background: var(--bg-input);
    color: var(--text-muted);
}

.status-en-curso {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-resuelta {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.card-body {
    padding: 1.5rem;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.loc-name {
    font-weight: 700;
    font-family: 'Outfit';
    font-size: 1.1rem;
}

.mac-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-media {
    margin: 1rem 0;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-height: 300px;
    display: none;
}

.card-media img,
.card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.action-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.action-btn:hover {
    background: var(--border);
}

.btn-delete {
    margin-left: auto;
    color: var(--danger);
}

/* Config Lists */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

.tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 6000;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    visibility: hidden;
    opacity: 0;
}

.toast.active {
    visibility: visible;
    opacity: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        position: absolute;
        z-index: 50;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

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

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.whatsapp-modal-card {
    max-width: 720px;
}

.modal-helper {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.whatsapp-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.whatsapp-summary>div,
.media-manual-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.summary-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.media-manual-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.media-preview {
    width: 110px;
    height: 90px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.media-preview img,
.media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-info {
    min-width: 0;
}

.media-info a {
    color: var(--primary);
    display: block;
    overflow-wrap: anywhere;
    margin-bottom: 0.35rem;
}

.media-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.manual-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.resolve-modal-card {
    max-width: 560px;
}

.resolve-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.resolve-files {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.resolve-file-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    cursor: pointer;
}

.resolve-file-card i {
    color: var(--primary);
    flex: 0 0 auto;
}

.resolve-file-card div {
    min-width: 0;
}

.resolve-file-card strong,
.resolve-file-card span {
    display: block;
}

.resolve-file-card strong {
    font-size: 0.9rem;
}

.resolve-file-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resolution-note {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 0.9rem;
    padding: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    color: var(--text);
}

.resolution-note i {
    color: var(--success);
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.resolution-note span {
    display: block;
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.resolution-note p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
    overflow-wrap: anywhere;
}

.closure-files {
    margin-top: 0.9rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(148, 163, 184, 0.08);
}

.closure-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
}

.closure-file-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.closure-file {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 54px;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
}

.closure-file img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
}

.closure-file i {
    color: var(--primary);
    flex: 0 0 auto;
}

.closure-file span {
    font-size: 0.85rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .whatsapp-summary,
    .manual-actions,
    .resolve-actions {
        grid-template-columns: 1fr;
    }

    .resolve-files,
    .closure-file-grid {
        grid-template-columns: 1fr;
    }

    .media-manual-box {
        align-items: stretch;
        flex-direction: column;
    }

    .media-preview {
        width: 100%;
        height: 180px;
    }
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 100;
}

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
    }
}

/* Filtros Dashboard */
.filters-toolbar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

/* Recent List */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.recent-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    background: rgba(245, 158, 11, 0.05);
}

.recent-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.recent-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#login-overlay input {
    background: var(--bg-card);
}

/* Mobile app experience */
.card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 760px) {
    :root {
        --bg: #f6f7f9;
        --bg-card: #ffffff;
        --bg-input: #f1f5f9;
        --text: #111827;
        --text-muted: #64748b;
        --border: #e2e8f0;
        --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
        --glass: rgba(255, 255, 255, 0.88);
    }

    body {
        display: block;
        overflow: hidden;
        background:
            radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 30rem),
            linear-gradient(180deg, #fff7ed 0, #f6f7f9 14rem);
    }

    .main-content {
        height: 100dvh;
        padding: calc(1.15rem + env(safe-area-inset-top)) 1rem 1rem;
        padding-bottom: calc(6rem + env(safe-area-inset-bottom));
        scroll-padding-bottom: 6rem;
        overflow-x: hidden;
    }

    .top-bar {
        align-items: flex-start;
        gap: 1rem;
        flex-direction: column;
        margin-bottom: 1rem;
        padding-top: 0.25rem;
    }

    .top-bar>div:last-child {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.65rem !important;
    }

    .top-bar>div:first-child {
        width: 100%;
        gap: 0 !important;
    }

    .title-group h1 {
        font-size: 1.7rem;
        line-height: 1.15;
        letter-spacing: 0;
    }

    .title-group p {
        font-size: 0.9rem;
        line-height: 1.35;
    }

    .menu-toggle {
        display: none !important;
    }

    .sidebar {
        position: fixed;
        inset: auto 0 0 0;
        left: 0;
        top: auto;
        width: 100%;
        height: calc(4.7rem + env(safe-area-inset-bottom));
        padding: 0.42rem 0.45rem calc(0.42rem + env(safe-area-inset-bottom));
        transform: none;
        z-index: 5000;
        border-right: none;
        border-top: 1px solid rgba(148, 163, 184, 0.22);
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(18px);
    }

    .sidebar.open {
        left: 0;
        transform: none;
    }

    .logo,
    .user-profile {
        display: none;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.15rem;
        height: 100%;
    }

    .nav-links li {
        min-width: 0;
    }

    .nav-item {
        justify-content: center;
        flex-direction: column;
        gap: 0.2rem;
        min-height: 100%;
        margin: 0;
        padding: 0.38rem 0.12rem;
        border-radius: 14px;
        color: #64748b;
        font-size: 0.62rem;
        font-weight: 700;
        text-align: center;
        line-height: 1.15;
    }

    .nav-item svg {
        width: 21px;
        height: 21px;
        stroke-width: 2.25;
    }

    .nav-item.active {
        background: #fff7ed;
        color: #111827;
        box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.28);
    }

    .nav-item:hover {
        background: #e2e8f0;
        color: #111827;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        margin-bottom: 0.9rem;
    }

    .kpi-card {
        padding: 0.95rem;
        min-height: 104px;
        border: none;
        border-radius: 16px;
        box-shadow: var(--shadow);
    }

    .kpi-label {
        font-size: 0.7rem;
        line-height: 1.25;
        color: #64748b;
        letter-spacing: 0;
    }

    .kpi-val {
        font-size: 2rem;
    }

    .filters-toolbar {
        padding: 0.9rem;
        gap: 0.75rem;
        margin-bottom: 1rem;
        border: none;
        border-radius: 16px;
        box-shadow: var(--shadow);
    }

    .filter-group {
        min-width: 100%;
    }

    .stats-grid {
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 1rem;
        border: none;
        border-radius: 16px;
        box-shadow: var(--shadow);
        overflow: hidden;
    }

    #page-notificar .card {
        width: 100%;
        max-width: none !important;
    }

    .card-title {
        margin-bottom: 1rem;
        font-size: 1rem;
    }

    .bar-item {
        grid-template-columns: 90px 1fr 28px;
        gap: 8px;
    }

    .form-grid {
        gap: 0.75rem;
        min-width: 0;
    }

    .input-group {
        margin-bottom: 0.75rem;
        min-width: 0;
    }

    input,
    select,
    textarea {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 50px;
        font-size: 16px;
        border-radius: 12px;
        border-color: #dbe3ef;
        background: #f8fafc;
    }

    select {
        appearance: auto;
    }

    textarea {
        min-height: 140px;
    }

    .file-upload {
        padding: 1.2rem;
        border-radius: 16px;
        background: #f8fafc;
    }

    .btn {
        min-height: 52px;
        width: 100%;
        padding: 12px 16px;
        border-radius: 14px;
        box-shadow: 0 8px 18px rgba(245, 158, 11, 0.22);
    }

    .btn-secondary {
        color: var(--text);
        box-shadow: none;
    }

    .feed {
        gap: 0.9rem;
    }

    .averia-card {
        border: none;
        border-radius: 18px;
        box-shadow: var(--shadow);
    }

    .card-body {
        padding: 1rem;
    }

    .meta-row {
        gap: 0.75rem;
        align-items: flex-start;
    }

    .loc-name {
        font-size: 1.12rem;
    }

    .mac-name {
        line-height: 1.35;
        margin-top: 0.15rem;
    }

    .priority-tag {
        white-space: nowrap;
        border-radius: 999px;
        padding: 0.35rem 0.65rem;
    }

    .card-media {
        max-height: 220px;
        border-radius: 14px;
    }

    .card-meta {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.8rem;
    }

    .card-meta>span {
        min-height: 30px;
        padding: 0.35rem 0.55rem;
        border-radius: 999px;
        background: #f8fafc;
    }

    .card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .action-btn {
        justify-content: center;
        min-height: 46px;
        padding: 10px 8px;
        border: none;
        border-radius: 13px;
        background: #f1f5f9;
        font-size: 0.82rem;
        font-weight: 700;
        color: #111827;
        min-width: 0;
        text-align: center;
    }

    .action-btn svg {
        width: 17px;
        height: 17px;
        flex: 0 0 auto;
    }

    .btn-delete {
        margin-left: 0;
    }

    .action-delete {
        color: var(--danger);
    }

    #page-feed .top-bar>div:last-child {
        grid-template-columns: 88px 1fr;
        gap: 0.6rem !important;
    }

    #page-feed #btn-feed-pdf {
        min-height: 50px;
        padding: 0 0.8rem;
    }

    #page-feed #search,
    #page-feed #filter-status {
        width: 100%;
        grid-column: 1 / -1;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-card {
        max-width: none;
        max-height: 92dvh;
        border: none;
        border-radius: 22px 22px 0 0;
        padding: 1.25rem;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
        box-shadow: 0 -16px 40px rgba(15, 23, 42, 0.2);
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
        top: 0.65rem;
        right: 0.65rem;
    }

    body.modal-open .sidebar {
        display: none;
    }

    #resolve-modal {
        align-items: stretch;
        justify-content: stretch;
    }

    #resolve-modal .resolve-modal-card {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        padding-top: calc(1.25rem + env(safe-area-inset-top));
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    #resolve-modal .input-group {
        flex: 0 0 auto;
        min-height: 0;
        margin-bottom: 0;
    }

    #resolve-comment {
        min-height: 24dvh;
        max-height: none;
        resize: none;
        line-height: 1.45;
        overflow-y: auto;
    }

    #resolve-modal .resolve-actions {
        position: sticky;
        bottom: 0;
        margin-top: 1rem;
        padding-top: 0.85rem;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--bg-card) 28%);
    }

    .whatsapp-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .media-preview {
        height: 150px;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: calc(5.4rem + env(safe-area-inset-bottom));
        transform: none;
        justify-content: center;
        text-align: center;
        padding: 0.9rem 1rem;
    }
}

@media (max-width: 380px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .card-actions {
        grid-template-columns: 1fr;
    }
}
