/* Plăți Casa Seciu - Custom Styles */

/* ===== Base & Typography ===== */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }
.dark ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ===== Navigation Links ===== */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.15s ease;
    text-decoration: none;
}
.nav-link:hover {
    color: #1d4ed8;
    background-color: #eff6ff;
}
.dark .nav-link:hover {
    color: #93c5fd;
    background-color: rgba(30, 58, 138, 0.3);
}
.nav-link.active {
    color: #1d4ed8;
    background-color: #dbeafe;
    font-weight: 600;
}
.dark .nav-link.active {
    color: #93c5fd;
    background-color: rgba(30, 58, 138, 0.4);
}

.mobile-nav-link {
    display: block;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s ease;
}
.mobile-nav-link:hover {
    color: #1d4ed8;
    background-color: #eff6ff;
}
.dark .mobile-nav-link {
    color: #d1d5db;
}
.dark .mobile-nav-link:hover {
    color: #93c5fd;
    background-color: rgba(30, 58, 138, 0.3);
}

/* ===== Buttons ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #2563eb;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 2.5rem;
}
.btn-primary:hover { background-color: #1d4ed8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.3); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.625rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 2.5rem;
}
.btn-secondary:hover { background-color: #f9fafb; border-color: #9ca3af; }
.dark .btn-secondary { background-color: #374151; color: #d1d5db; border-color: #4b5563; }
.dark .btn-secondary:hover { background-color: #4b5563; }

.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #059669;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 2.5rem;
}
.btn-success:hover { background-color: #047857; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #dc2626;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 2.5rem;
}
.btn-danger:hover { background-color: #b91c1c; }

/* ===== Icon Buttons ===== */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border-radius: 0.375rem;
    color: #6b7280;
    transition: all 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    min-width: 2rem;
    min-height: 2rem;
}
.icon-btn:hover { color: #1d4ed8; background-color: #eff6ff; }
.dark .icon-btn { color: #9ca3af; }
.dark .icon-btn:hover { color: #93c5fd; background-color: rgba(30,58,138,0.2); }

/* ===== Form Inputs ===== */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}
.dark .form-label { color: #d1d5db; }

.form-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #111827;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    min-height: 2.5rem;
}
.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.form-input::placeholder { color: #9ca3af; }
.dark .form-input {
    color: #f9fafb;
    background-color: #1f2937;
    border-color: #374151;
}
.dark .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.dark .form-input::placeholder { color: #6b7280; }

/* ===== KPI Cards ===== */
.kpi-card {
    border-radius: 0.875rem;
    padding: 1rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.dark .kpi-card { border-color: #374151; }

/* ===== Touch Targets (mobile) ===== */
.touch-target { min-height: 44px; min-width: 44px; }

/* ===== Dark mode bg-gray-750 workaround ===== */
.dark .bg-gray-750 { background-color: #2d3748; }
.bg-gray-750 { background-color: #f3f4f6; }

/* ===== Invoice Status Colors ===== */
.status-neplatita { @apply text-red-700 bg-red-100; }
.status-partial   { @apply text-yellow-700 bg-yellow-100; }
.status-platita   { @apply text-green-700 bg-green-100; }

/* ===== Loading Spinner ===== */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(37,99,235,0.3);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Card Hover Effects ===== */
.card-hover {
    transition: all 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* ===== Dark Mode Transitions ===== */
html { transition: background-color 0.2s ease; }

/* ===== Dark mode icon toggles ===== */
html.dark .dark-icon-moon { display: none; }
html.dark .dark-icon-sun  { display: block !important; }
html:not(.dark) .dark-icon-moon { display: block; }
html:not(.dark) .dark-icon-sun  { display: none; }

/* ===== Flash Message Container ===== */
#flash-messages { pointer-events: none; }
#flash-messages > div { pointer-events: all; }

/* ===== Print Styles ===== */
@media print {
    nav, .btn-primary, .btn-secondary, .btn-danger, .btn-success,
    #flash-messages, footer { display: none !important; }

    body { background: white; color: black; }

    .bg-white { background: white; }
    table { border-collapse: collapse; width: 100%; }
    th, td { border: 1px solid #ccc; padding: 6px 10px; font-size: 12px; }
    th { background: #f5f5f5; font-weight: bold; }

    .rounded-xl, .rounded-lg { border-radius: 0; }
    .shadow-sm, .shadow { box-shadow: none; }
    .border { border: 1px solid #e5e7eb; }

    @page {
        margin: 1.5cm;
        size: A4 landscape;
    }
}

/* ===== Responsive Table ===== */
@media (max-width: 640px) {
    .form-input { font-size: 16px; } /* Prevent zoom on iOS */
}
