/* ============================================================
   RESET + БАЗА
   ============================================================ */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
/* ============================================================
   LOGIN PAGE
   ============================================================ */
.empty-layout {
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
}

.login-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.login-logo {
    font-size: 56px;
    text-align: center;
    margin-bottom: 8px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: #0F172A;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: #64748B;
    font-size: 14px;
    margin-bottom: 24px;
}
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    background: #F8FAFC;
    color: #1E293B;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
    color: #0F172A;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

a {
    color: #2563EB;
    text-decoration: none;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.app-title {
    font-size: 17px;
    font-weight: 700;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.app-content {
    flex: 1;
    padding: 16px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    padding: 16px;
    text-align: center;
    color: #94A3B8;
    font-size: 12px;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
    min-height: 44px;
    user-select: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563EB;
    color: white;
}

.btn-primary:hover {
    background: #1D4ED8;
}

.btn-secondary {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}

.btn-danger {
    background: #DC2626;
    color: white;
}

.btn-success {
    background: #16A34A;
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    color: #64748B;
    font-size: 18px;
}

.btn-icon:hover {
    background: #F1F5F9;
}

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.card-clickable {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.card-clickable:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 600;
    font-size: 16px;
    color: #0F172A;
}

.card-subtitle {
    font-size: 13px;
    color: #64748B;
    margin-top: 2px;
}

/* ============================================================
   ФОРМЫ
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #FFFFFF;
    color: #0F172A;
    min-height: 44px;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 12px;
}

.alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.alert-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

/* ============================================================
   СПИСКИ
   ============================================================ */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #FFFFFF;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background 0.1s;
}

.list-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.list-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.list-item:hover {
    background: #F8FAFC;
}

.list-container {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

/* ============================================================
   СУММЫ
   ============================================================ */
.amount {
    font-weight: 700;
    font-size: 16px;
}

.amount-debt {
    color: #DC2626;
}

.amount-paid {
    color: #16A34A;
}

/* ============================================================
   UTIL
   ============================================================ */
.text-muted { color: #64748B; }
.text-small { font-size: 13px; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2563EB;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    flex-direction: column;
    gap: 12px;
}
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94A3B8;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}