/* Картки та форми */
.card { background: var(--bg-card); padding: 30px; border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 30px; border: 1px solid var(--border-light); width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 15px; margin-bottom: 20px; align-items: end; width: 100%; }
.form-grid-wide { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 20px; align-items: end; }
.field label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }

input, select { width: 100%; padding: 12px 14px; border: 1px solid var(--border-input); border-radius: 10px; font-size: 0.95rem; font-family: inherit; transition: 0.2s; background: white; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* Кнопки */
button { font-family: inherit; transition: 0.2s; cursor: pointer; }
.btn-primary { background-color: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 10px; font-weight: 600; height: 44px; display: flex; align-items: center; justify-content: center; }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: white; color: var(--text-dark); border: 1px solid var(--border-input); padding: 10px 20px; border-radius: 10px; font-weight: 600; height: 44px; }
.btn-excel { background-color: #0d9488; color: white; border: none; padding: 10px 20px; border-radius: 10px; font-weight: 600; }
.full-width { width: 100%; }

/* Логін */
.login-container { position: fixed; inset: 0; background-color: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.login-card { background: var(--bg-card); padding: 40px; border-radius: 24px; width: 100%; max-width: 400px; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: 30px; text-align: center; }

/* Модальні вікна */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 3000; }
.modal-content { max-width: 450px; width: 90%; background: #fff; padding: 20px; border-radius: 12px; }

/* Дашборд віджети */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; margin-bottom: 30px; }
.stat-card { background: var(--bg-card); padding: 30px 25px; border-radius: 20px; border: 1px solid var(--border-light); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center; }
.stat-card h3 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .number { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin: 0; line-height: 1; }
.stat-card.alert .number { color: #ea580c; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 25px; }

/* UI Компоненти (Toasts, Skeletons, Timeline, Drag&Drop) */
#toastContainer { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 250px; padding: 15px 20px; border-radius: 8px; color: white; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); animation: slideInUp 0.3s ease forwards; }
.toast.success { background-color: #10b981; }
.toast.error { background-color: #ef4444; }
.toast.info { background-color: #3b82f6; }
.toast .close-toast { cursor: pointer; font-weight: bold; margin-left: 15px; }
@keyframes slideInUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.skeleton { background: #e2e8f0; border-radius: 4px; animation: shimmer 1.5s infinite linear; }
@keyframes shimmer { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
.skeleton-row td div { height: 20px; width: 80%; border-radius: 4px; }

.timeline { border-left: 2px solid #3b82f6; margin: 20px 0 20px 10px; padding-left: 20px; list-style: none; }
.timeline li { position: relative; margin-bottom: 20px; }
.timeline li::before { content: ''; position: absolute; left: -27px; top: 0; width: 12px; height: 12px; background: #3b82f6; border-radius: 50%; box-shadow: 0 0 0 4px #eff6ff; }
.timeline-date { font-size: 12px; color: #64748b; font-weight: bold; display: block; margin-bottom: 4px; }

.draggable-row { cursor: grab; }
.draggable-row:active { cursor: grabbing; opacity: 0.5; }
.drag-over { border-top: 2px dashed #3b82f6 !important; background-color: #eff6ff !important; }

/* Темна тема Компонентів */
body.dark-mode .card, body.dark-mode .dashboard-grid > div, body.dark-mode .stat-card { background-color: #1e293b !important; border-color: #334155 !important; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5) !important; color: #f8fafc !important; }
body.dark-mode input, body.dark-mode select, body.dark-mode input[type="file"] { background-color: #0f172a !important; color: #f8fafc !important; border-color: #475569 !important; }
body.dark-mode input::placeholder { color: #475569 !important; }
body.dark-mode input:focus, body.dark-mode select:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important; }
body.dark-mode .modal-content { background-color: #1e293b !important; border: 1px solid #475569 !important; }
body.dark-mode .modal-overlay { background: rgba(0, 0, 0, 0.8) !important; }
body.dark-mode .btn-secondary { background-color: #334155 !important; border-color: #475569 !important; color: #f8fafc !important; }
body.dark-mode .btn-secondary:hover { background-color: #475569 !important; }
body.dark-mode .stat-card.alert { background: #450a0a !important; border-color: #7f1d1d !important; }
body.dark-mode .stat-card.alert .number { color: #fca5a5 !important; }
body.dark-mode .stat-card .number { color: #f8fafc !important; }
body.dark-mode .skeleton { background: #334155 !important; }
body.dark-mode .timeline li::before { box-shadow: 0 0 0 4px #1e293b; }
body.dark-mode .drag-over { background-color: #0f172a !important; }
body.dark-mode label, body.dark-mode p { color: #94a3b8 !important; }

/* Кастомні кольори карток */
body.dark-mode div[style*="background: #f8fafc"], body.dark-mode div[style*="background-color: #f8fafc"] { background-color: #1e293b !important; border-left-color: #3b82f6 !important; }
body.dark-mode div[style*="background: #f0fdf4"] { background-color: #064e3b !important; border-color: #065f46 !important; }
body.dark-mode div[style*="background: #fef2f2"] { background-color: #7f1d1d !important; border-color: #991b1b !important; }
body.dark-mode div[style*="background: #f0fdf4"] h4, body.dark-mode div[style*="background: #f0fdf4"] p { color: #a7f3d0 !important; }
body.dark-mode div[style*="background: #fef2f2"] h3, body.dark-mode div[style*="background: #fef2f2"] p { color: #fca5a5 !important; }
#themeToggleBtn { background-color: #f1f5f9 !important; color: #0f172a !important; border: 1px solid #cbd5e1 !important; font-weight: 600; }
body.dark-mode #themeToggleBtn { background-color: #1e293b !important; color: #f8fafc !important; border: 1px solid #475569 !important; }

/* =========================================
   КАБІНЕТИ: СПЕЦИФІКАЦІЇ ПК (AIDA64) ТА ДРОПДАУНИ
   ========================================= */

/* Дропдаун автопошуку */
.autocomplete-item {
   padding: 10px 12px; border-bottom: 1px solid var(--border-light); 
   cursor: pointer; font-size: 13px; color: var(--text-dark); 
   transition: background 0.2s;
}
.autocomplete-item:hover { background-color: #f8fafc; }
body.dark-mode .autocomplete-item:hover { background-color: #334155; }

/* Текстові утиліти (Кольори статусів та акцентів) */
.text-success { color: #10b981 !important; font-weight: bold; }
.text-danger { color: #ef4444 !important; font-weight: bold; }
.text-warning { color: #eab308 !important; font-weight: bold; }
.text-info { color: #0284c7 !important; font-weight: 500; }
.text-primary { color: var(--primary) !important; font-weight: bold; }
.text-muted { color: var(--text-muted) !important; }
.text-muted-italic { color: var(--text-muted) !important; font-style: italic; }

body.dark-mode .text-info { color: #38bdf8 !important; } /* Світліший синій для темної теми */

/* Елементи таблиці */
.btn-micro { padding: 4px 8px; font-size: 10px; cursor: pointer; margin-top: 5px; }
.btn-specs { border-color: #8b5cf6; color: #8b5cf6; }
body.dark-mode .btn-specs { border-color: #a855f7; color: #a855f7; }
.btn-action { padding: 4px 8px; font-size: 12px; }
.muted-small { font-size: 11px; color: var(--text-muted); }

/* Модалка Характеристик */
.specs-header { margin-bottom: 15px; font-size: 15px; border-bottom: 1px dashed var(--border-light); padding-bottom: 10px; }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; font-size: 13px; }
.spec-item { margin-bottom: 8px; line-height: 1.4; }
.spec-label { font-weight: bold; color: var(--text-dark); }
.spec-value { color: var(--text-muted); }
.ul-item { margin-left: 25px; }
.ul-subitem { margin-left: 25px; font-size: 12px; color: var(--text-muted); }