:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --dark: #111827;
    --danger: #b91c1c;
    --success: #166534;
    --warning: #92400e;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 68px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--dark);
    color: #fff;
}

.brand {
    font-weight: 800;
    font-size: 18px;
}

.brand-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #cbd5e1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.link-muted {
    color: #cbd5e1;
    text-decoration: none;
}

.mobile-nav {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.mobile-nav a {
    white-space: nowrap;
    text-decoration: none;
    padding: 8px 11px;
    border-radius: 10px;
    background: #f3f4f6;
    font-size: 14px;
}

.container {
    width: min(1100px, calc(100% - 24px));
    margin: 18px auto 80px;
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-head h1 {
    margin: 0 0 4px;
    font-size: 24px;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card, .panel, .auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(17,24,39,.04);
}

.stat-card {
    padding: 16px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    margin-top: 6px;
    font-size: 32px;
    font-weight: 800;
}

.stat-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.panel {
    padding: 18px;
}

.panel h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.panel p {
    margin: 0;
    color: var(--muted);
}

.check-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.check-list > div {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin: 12px 0 7px;
    font-size: 13px;
    font-weight: 700;
}

input, textarea, select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(17,24,39,.15);
    border-color: #9ca3af;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--dark);
    color: #fff;
}

.btn-block {
    width: 100%;
    margin-top: 16px;
}

.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 18px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 24px;
}

.auth-logo {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
}

.auth-sub {
    color: var(--muted);
    text-align: center;
    margin-top: 6px;
    margin-bottom: 18px;
}

.alert {
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-danger {
    background: #fef2f2;
    color: var(--danger);
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
}

.alert-warning {
    background: #fffbeb;
    color: var(--warning);
}

.footer {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 800px) {
    .grid-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid,
    .check-list {
        grid-template-columns: 1fr;
    }

    .field-full {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(100% - 16px, 1100px);
        margin-top: 10px;
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar-user {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    .grid-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 13px;
    }

    .stat-value {
        font-size: 28px;
    }

    .panel {
        padding: 14px;
    }
}


/* Faz 2 */
.page-head-actions {
    align-items: center;
}

.btn-light {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.search-row {
    display: flex;
    gap: 8px;
}

.search-row input {
    flex: 1;
}

.panel-gap {
    margin-top: 14px;
}

.customer-list,
.device-list,
.simple-list {
    display: grid;
    gap: 8px;
}

.customer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    background: #fff;
}

.customer-card:hover {
    background: #f9fafb;
}

.customer-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.customer-main span,
.customer-main small,
.simple-list-row small,
.device-card small {
    color: var(--muted);
}

.customer-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    background: #f3f4f6;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.chevron {
    color: #9ca3af;
    font-size: 28px;
    line-height: 1;
}

.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    text-align: center;
    color: var(--muted);
}

.empty-state.compact {
    min-height: 90px;
}

.empty-state strong {
    color: var(--text);
}

.action-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 14px;
}

.two-col-narrow {
    grid-template-columns: minmax(260px, .8fr) minmax(0, 2fr);
}

.summary-list {
    display: grid;
    gap: 0;
    margin: 14px 0 0;
}

.summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.summary-list dt {
    color: var(--muted);
}

.summary-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.device-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #f9fafb;
}

.device-card > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-type {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 7px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
}

.details-box {
    margin-top: 14px;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: 12px;
}

.details-box summary {
    cursor: pointer;
    font-weight: 800;
}

.device-form {
    margin-top: 14px;
}

.simple-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.simple-list-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 800px) {
    .two-col,
    .two-col-narrow {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .page-head-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-head-actions .btn {
        width: 100%;
    }

    .search-row {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .search-row .btn-light {
        grid-column: 1 / -1;
    }

    .customer-card {
        padding: 12px;
    }

    .pill {
        display: none;
    }

    .action-row {
        flex-direction: column;
    }

    .action-row .btn {
        width: 100%;
    }
}


/* Faz 3 */
.search-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px auto auto;
    gap: 8px;
}

.service-list {
    display: grid;
    gap: 8px;
}

.service-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
}

.service-card:hover {
    background: #f9fafb;
}

.service-card-main {
    min-width: 0;
    width: 100%;
}

.service-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.service-name {
    font-weight: 700;
}

.service-device,
.service-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.service-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    background: #f3f4f6;
    color: #374151;
}

.status-large {
    min-height: 32px;
    padding: 6px 11px;
    font-size: 12px;
}

.status-new { background: #eff6ff; color: #1d4ed8; }
.status-review { background: #eef2ff; color: #4338ca; }
.status-wait { background: #fffbeb; color: #92400e; }
.status-approved { background: #ecfdf5; color: #047857; }
.status-part { background: #fff7ed; color: #c2410c; }
.status-repair { background: #f5f3ff; color: #6d28d9; }
.status-done { background: #ecfeff; color: #0f766e; }
.status-ready { background: #f0fdf4; color: #166534; }
.status-delivered { background: #f3f4f6; color: #374151; }
.status-cancel { background: #fef2f2; color: #b91c1c; }

.section-number {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--dark);
    color: #fff;
    font-weight: 800;
    margin-bottom: 10px;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.segmented label {
    margin: 0;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.segmented input:checked + span {
    background: var(--dark);
    color: #fff;
    border-color: var(--dark);
}

.mode-box {
    margin-top: 12px;
}

.hidden {
    display: none !important;
}

.help-text {
    color: var(--muted);
    font-size: 12px;
}

.sticky-submit {
    position: sticky;
    bottom: 12px;
    display: flex;
    justify-content: flex-end;
    padding: 12px 0;
    z-index: 10;
}

.btn-large {
    min-height: 50px;
    padding: 12px 22px;
    box-shadow: 0 10px 24px rgba(17,24,39,.18);
}

.service-hero {
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 16px;
    background: var(--dark);
    color: #fff;
}

.service-device-title {
    margin-top: 14px;
    font-size: 20px;
    font-weight: 800;
}

.service-device-sub {
    margin-top: 5px;
    color: #cbd5e1;
    font-size: 13px;
}

.stack {
    display: grid;
    align-content: start;
    gap: 14px;
}

.inline-status-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.timeline {
    display: grid;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 16px;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 11px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--dark);
    z-index: 1;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.timeline-content span,
.timeline-content small {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 800px) {
    .search-filter-row {
        grid-template-columns: 1fr 1fr;
    }

    .search-filter-row input {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .search-filter-row {
        grid-template-columns: 1fr;
    }

    .search-filter-row input {
        grid-column: auto;
    }

    .service-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .inline-status-form {
        grid-template-columns: 1fr;
    }

    .sticky-submit {
        bottom: 6px;
    }

    .sticky-submit .btn {
        width: 100%;
    }
}


/* Faz 4 */
.note-internal,
.note-customer {
    padding: 12px;
    border-radius: 12px;
}

.note-internal {
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.note-customer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.financial-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 16px;
}

.financial-summary > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
}

.financial-summary span {
    color: var(--muted);
    font-size: 12px;
}

.financial-summary strong {
    font-size: 17px;
}

.compact-form {
    margin-bottom: 16px;
}

.item-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.item-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.item-table th,
.item-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.item-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.item-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.btn-icon-danger {
    width: 30px;
    height: 30px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 20px;
    cursor: pointer;
}

.photo-upload-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.photo-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #e5e7eb;
}

.photo-info {
    display: grid;
    gap: 5px;
    padding: 10px;
}

.photo-info small {
    color: var(--muted);
}

.btn-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}

.customer-note-preview {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.customer-note-preview p {
    color: var(--text);
    line-height: 1.55;
}

@media (max-width: 800px) {
    .financial-summary {
        grid-template-columns: 1fr;
    }

    .photo-upload-form {
        grid-template-columns: 1fr;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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


/* Faz 5 */
.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.payment-summary-grid > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
}

.payment-summary-grid span {
    color: var(--muted);
    font-size: 12px;
}

.payment-summary-grid strong {
    font-size: 18px;
}

.payment-due {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

.payment-due strong {
    color: #b91c1c;
}

.payment-ok {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}

.payment-ok strong {
    color: #166534;
}

.payment-list {
    display: grid;
    gap: 8px;
}

.payment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.payment-card-link {
    text-decoration: none;
}

.payment-card-link:hover {
    background: #f9fafb;
}

.payment-card-main {
    min-width: 0;
    flex: 1;
}

.payment-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.payment-card small,
.payment-desc {
    color: var(--muted);
    font-size: 12px;
}

.payment-desc {
    margin: 4px 0;
}

.payment-filter-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.payment-filter-button {
    justify-content: end;
}

.stat-money {
    font-size: 22px;
}

@media (max-width: 800px) {
    .payment-summary-grid {
        grid-template-columns: 1fr;
    }

    .payment-filter-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .payment-card-top {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Faz 6 */
.report-filter {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.report-filter-button {
    justify-content: end;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.report-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.report-card span {
    color: var(--muted);
    font-size: 12px;
}

.report-card strong {
    font-size: 18px;
}

.report-grid,
.dashboard-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bar-list {
    display: grid;
    gap: 12px;
}

.bar-row {
    display: grid;
    gap: 6px;
}

.bar-row-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.bar-track {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.bar-fill {
    height: 100%;
    min-width: 2px;
    background: #111827;
    border-radius: 999px;
}

.payment-type-list,
.simple-metric-list {
    display: grid;
}

.payment-type-list > div,
.simple-metric-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.payment-type-list > div:last-child,
.simple-metric-list > div:last-child {
    border-bottom: 0;
}

.payment-type-list span,
.simple-metric-list span {
    color: var(--muted);
}

@media (max-width: 1100px) {
    .report-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .report-grid,
    .dashboard-two-col,
    .report-filter {
        grid-template-columns: 1fr;
    }

    .report-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .report-cards {
        grid-template-columns: 1fr;
    }
}


/* Faz 7 */
.page-head-actions > .action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 520px) {
    .page-head-actions > .action-row {
        width: 100%;
        flex-direction: column;
    }

    .page-head-actions > .action-row .btn {
        width: 100%;
    }
}


/* Yerel QR + Faz 8 */
.whatsapp-panel {
    margin-bottom: 14px;
}

.whatsapp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-whatsapp {
    background: #166534;
    color: #fff;
}

.template-help {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid var(--border);
}

.template-help code {
    padding: 4px 7px;
    border-radius: 7px;
    background: #e5e7eb;
    font-size: 12px;
}

.template-form {
    display: grid;
    gap: 14px;
}

.template-field textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.45;
}

@media (max-width: 520px) {
    .whatsapp-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .whatsapp-actions .btn {
        width: 100%;
    }
}


/* Faz 9 */
.license-meta {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    color: var(--muted);
    word-break: break-all;
}


/* Faz 11 */
.user-list {
    display: grid;
    gap: 8px;
}

.user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
}

.user-card > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-card span,
.user-card small,
.user-card-meta {
    color: var(--muted);
    font-size: 12px;
}

.user-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-danger-soft {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-success-soft {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

@media (max-width: 520px) {
    .user-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-card-meta {
        width: 100%;
        justify-content: space-between;
    }
}


/* Faz 12 */
.row-critical {
    background: #fef2f2;
}

.row-critical td {
    border-bottom-color: #fecaca;
}

.text-danger {
    color: #b91c1c !important;
}


/* Faz 13 */
.warranty-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.warranty-summary > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
}

.warranty-summary span {
    color: var(--muted);
    font-size: 12px;
}

.text-success {
    color: #166534 !important;
}

.previous-service-box {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    border-radius: 12px;
}

.history-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.history-list a {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto auto;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    font-size: 12px;
}

@media (max-width:800px) {
    .warranty-summary {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .history-list a {
        grid-template-columns: 1fr;
    }
}


/* Faz 14 */
.appointment-filter {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.appointment-days {
    display: grid;
    gap: 14px;
}

.appointment-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.appointment-day-head > div {
    display: grid;
    gap: 3px;
}

.appointment-day-head span {
    color: var(--muted);
    font-size: 12px;
}

.appointment-list {
    display: grid;
    gap: 8px;
}

.appointment-card {
    display: grid;
    grid-template-columns: 70px minmax(0,1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    background: #fff;
}

.appointment-time {
    font-size: 20px;
    font-weight: 800;
}

.appointment-main {
    display: grid;
    gap: 3px;
}

.appointment-main span,
.appointment-main small {
    color: var(--muted);
}

@media (max-width: 800px) {
    .appointment-filter {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .appointment-card {
        grid-template-columns: 56px minmax(0,1fr);
    }

    .appointment-card .status-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }
}


/* Faz 15 */
.health-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 10px;
}

.health-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.health-card span {
    color: var(--muted);
    font-size: 12px;
}

.health-card strong {
    font-size: 15px;
}

.health-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.health-bad {
    border-color: #fecaca;
    background: #fef2f2;
}

.backup-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-color: #fde68a;
    background: #fffbeb;
}

.backup-warning p {
    margin: 4px 0 0;
}

@media (max-width: 1000px) {
    .health-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

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

    .backup-warning {
        align-items: stretch;
        flex-direction: column;
    }
}


/* Faz 17 */
.update-warning {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
}

.update-warning p {
    margin: 5px 0 0;
    color: #92400e;
}
