/* COSTAKEY — plain CSS (Tailwind CDN does not process @apply in external files) */

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    transition: background-color 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background-color: #f3f4f6;
    color: #0284c7;
}

.dark .sidebar-link {
    color: #9ca3af;
}

.dark .sidebar-link:hover {
    background-color: #1f2937;
    color: #38bdf8;
}

.property-card {
    background-color: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    transition: box-shadow 0.3s, transform 0.3s;
}

.dark .property-card {
    background-color: #111827;
    border-color: #1f2937;
}

.property-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.stat-card {
    background-color: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark .stat-card {
    background-color: #111827;
    border-color: #1f2937;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #0284c7;
    color: #fff !important;
    font-weight: 500;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-primary:hover {
    background-color: #0369a1;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #f3f4f6;
    color: #374151 !important;
    font-weight: 500;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.dark .btn-secondary {
    background-color: #1f2937;
    color: #d1d5db !important;
}

/* Form inputs — explicit colors for light & dark */
.input-field,
input.input-field,
select.input-field,
textarea.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    background-color: #fff;
    color: #111827;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    color-scheme: light;
}

.input-field::placeholder {
    color: #6b7280;
}

.input-field:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.dark .input-field,
.dark input.input-field,
.dark select.input-field,
.dark textarea.input-field {
    background-color: #111827;
    border-color: #374151;
    color: #f9fafb;
    color-scheme: dark;
}

.dark .input-field::placeholder {
    color: #9ca3af;
}

/* Date/time/number — fix invisible text on white background */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"] {
    color: #111827;
    background-color: #fff;
    color-scheme: light;
}

.dark input[type="date"],
.dark input[type="time"],
.dark input[type="datetime-local"],
.dark input[type="number"] {
    color: #f9fafb;
    background-color: #111827;
    color-scheme: dark;
}

/* Hero search — always dark text on light card (parent may have text-white) */
.hero-search-form {
    color: #111827 !important;
}

.hero-search-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4b5563 !important;
    margin-bottom: 0.375rem;
}

.hero-search-field,
.hero-search-form input[type="text"],
.hero-search-form input[type="date"],
.hero-search-form input[type="number"] {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #d1d5db !important;
    background-color: #f3f4f6 !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color-scheme: light !important;
    box-sizing: border-box;
}

.hero-search-field::placeholder {
    color: #6b7280 !important;
    -webkit-text-fill-color: #6b7280 !important;
    opacity: 1;
}

.hero-search-field:focus {
    outline: none;
    border-color: #0284c7 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.hero-search-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.7;
    cursor: pointer;
}

/* Legacy search-input */
.search-input {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    background-color: #f3f4f6;
    color: #111827;
    font-size: 1rem;
    color-scheme: light;
}

select.input-field option {
    background-color: #fff;
    color: #111827;
}

.dark select.input-field option {
    background-color: #111827;
    color: #f9fafb;
}

.skeleton {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
}

.dark .skeleton {
    background-color: #1f2937;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

[x-cloak] {
    display: none !important;
}

.legal-content a {
    color: #0284c7;
    text-decoration: underline;
}

.legal-content a:hover {
    color: #0369a1;
}

.dark .legal-content a {
    color: #38bdf8;
}

.legal-content code {
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: #f3f4f6;
    color: #1f2937;
}

.dark .legal-content code {
    background-color: #374151;
    color: #e5e7eb;
}

/* ——— Dashboard (mobile-first) ——— */

.safe-top {
    padding-top: env(safe-area-inset-top, 0);
}

.sidebar-link--danger {
    color: #dc2626 !important;
}

.sidebar-link--danger:hover {
    background-color: #fef2f2;
    color: #b91c1c !important;
}

.dark .sidebar-link--danger:hover {
    background-color: rgba(127, 29, 29, 0.25);
    color: #f87171 !important;
}

.dash-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

@media (min-width: 640px) {
    .dash-page-title {
        font-size: 1.25rem;
    }
}

.dash-grid-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .dash-grid-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.dash-grid-cards .stat-card {
    padding: 1rem;
}

@media (min-width: 768px) {
    .dash-grid-cards .stat-card {
        padding: 1.5rem;
    }
}

.dash-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.dark .dash-row {
    border-bottom-color: #1f2937;
}

.dash-row:last-child {
    border-bottom: none;
}

@media (min-width: 640px) {
    .dash-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
}

.dash-row__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .dash-row__actions {
        align-items: flex-end;
        text-align: right;
    }
}

.table-scroll {
    margin-left: -1rem;
    margin-right: -1rem;
    overflow-x: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
    .table-scroll {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

.table-scroll table {
    min-width: 36rem;
    width: 100%;
}

.stat-card--flush-mobile {
    padding: 1rem;
}

@media (min-width: 640px) {
    .stat-card--flush-mobile {
        padding: 1.5rem;
    }
}
