/* Union Hisab Manager - Styles */
:root {
    --uh-primary: #1565C0;
    --uh-green: #2E7D32;
    --uh-red: #C62828;
    --uh-blue: #1565C0;
    --uh-orange: #E65100;
    --uh-bg: #f4f6fb;
    --uh-card: #fff;
    --uh-border: #e0e6ef;
    --uh-text: #2d3748;
    --uh-radius: 12px;
}

* { box-sizing: border-box; }

.uh-app {
    font-family: 'Noto Sans Bengali', 'Hind Siliguri', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    background: var(--uh-bg);
    min-height: 400px;
}

.uh-card {
    background: var(--uh-card);
    border-radius: var(--uh-radius);
    box-shadow: 0 4px 24px rgba(21,101,192,0.10);
    overflow: hidden;
}

.uh-auth-card {
    max-width: 440px;
    margin: 40px auto;
    padding: 0 0 24px;
}

/* Header */
.uh-header {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: #fff;
    padding: 24px 28px 20px;
    text-align: center;
}
.uh-header h2 {
    margin: 0 0 6px;
    font-size: 1.3em;
    font-weight: 700;
}
.uh-header p {
    margin: 0;
    opacity: 0.88;
    font-size: 0.95em;
}
.uh-user-info {
    margin-top: 10px;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Tabs */
.uh-tabs {
    display: flex;
    border-bottom: 2px solid var(--uh-border);
    background: #f8fafc;
}
.uh-tab {
    flex: 1;
    padding: 13px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #888;
    transition: all .2s;
}
.uh-tab.active {
    color: var(--uh-primary);
    border-bottom: 3px solid var(--uh-primary);
    background: #fff;
}

.uh-tab-content { display: none; padding: 22px 28px; }
.uh-tab-content.active { display: block; }

/* Form Elements */
.uh-form-group {
    margin-bottom: 14px;
}
.uh-form-group label {
    display: block;
    font-size: 0.88em;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}
.uh-form-group input,
.uh-form-group select,
.uh-form-group textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--uh-border);
    border-radius: 8px;
    font-size: 0.97em;
    transition: border-color .2s;
    font-family: inherit;
    background: #fafbfc;
}
.uh-form-group input:focus,
.uh-form-group select:focus,
.uh-form-group textarea:focus {
    outline: none;
    border-color: var(--uh-primary);
    background: #fff;
}

.uh-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

/* Buttons */
.uh-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    font-family: inherit;
    transition: all .18s;
}
.uh-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.uh-btn-primary { background: var(--uh-primary); color: #fff; }
.uh-btn-success { background: var(--uh-green); color: #fff; }
.uh-btn-danger  { background: var(--uh-red);   color: #fff; }
.uh-btn-warning { background: #F57C00;          color: #fff; }
.uh-btn-secondary { background: #90A4AE;        color: #fff; }
.uh-btn-sm { padding: 5px 10px; font-size: 0.82em; }
.uh-btn-primary, .uh-btn-success { width: 100%; margin-top: 4px; }

/* Messages */
.uh-msg {
    font-size: 0.9em;
    margin: 8px 0;
    padding: 0;
    min-height: 20px;
}
.uh-msg.success { color: var(--uh-green); }
.uh-msg.error   { color: var(--uh-red);   }

.uh-default-creds {
    text-align: center;
    margin-top: 12px;
    color: #999;
}

/* Summary Cards */
.uh-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 20px 20px 0;
}
.uh-sum-card {
    border-radius: 10px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.uh-green { background: #E8F5E9; }
.uh-red   { background: #FFEBEE; }
.uh-blue  { background: #E3F2FD; }

.uh-sum-label { font-size: 0.82em; font-weight: 600; color: #555; }
.uh-sum-val { font-size: 1.3em; font-weight: 700; }
.uh-green .uh-sum-val { color: var(--uh-green); }
.uh-red   .uh-sum-val { color: var(--uh-red);   }
.uh-blue  .uh-sum-val { color: var(--uh-blue);  }

/* Section Title */
.uh-section-title {
    padding: 18px 20px 8px;
    margin: 0;
    font-size: 1em;
    color: #444;
    border-top: 1px solid var(--uh-border);
    margin-top: 16px;
}

/* Add Form */
.uh-add-form {
    padding: 0 20px 14px;
}

/* Table */
.uh-table-wrap {
    padding: 0 20px 20px;
    overflow-x: auto;
}
.uh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.91em;
}
.uh-table th {
    background: #1565C0;
    color: #fff;
    padding: 10px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.uh-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--uh-border);
    vertical-align: middle;
}
.uh-table tbody tr:hover { background: #f0f7ff; }
.uh-table tfoot td {
    border-top: 2px solid var(--uh-primary);
    background: #EEF4FF;
    padding: 10px;
}
.uh-dashboard-table th { background: #0D47A1; }

.uh-green-text { color: var(--uh-green); font-weight: 600; }
.uh-red-text   { color: var(--uh-red);   font-weight: 600; }
.uh-blue-text  { color: var(--uh-blue);  font-weight: 600; }
.uh-total-row td { font-weight: 700; }

.uh-action-btns { white-space: nowrap; display: flex; gap: 6px; }

.uh-empty {
    text-align: center;
    color: #aaa;
    padding: 30px;
    font-style: italic;
}

/* Modal */
.uh-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.uh-modal[style*="display:none"],
.uh-modal[style*="display: none"] {
    display: none !important;
}
.uh-modal-inner {
    background: #fff;
    border-radius: var(--uh-radius);
    padding: 28px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.uh-modal-inner h3 {
    margin: 0 0 18px;
    color: var(--uh-primary);
}
.uh-modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.uh-modal-btns .uh-btn { flex: 1; width: auto; }

/* Loading */
.uh-loading { opacity: 0.6; pointer-events: none; }

@media (max-width: 600px) {
    .uh-summary-cards { grid-template-columns: 1fr; }
    .uh-form-row { grid-template-columns: 1fr; }
    .uh-table { font-size: 0.82em; }
    .uh-header h2 { font-size: 1.1em; }
    .uh-add-form, .uh-table-wrap { padding: 0 12px 14px; }
}

/* ===== ADMIN & ROLE BADGES ===== */
.uh-badge-admin {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
    letter-spacing: 0.5px;
}
.uh-badge-user {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ===== MAIN NAV TABS ===== */
.uh-main-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e0e7ef;
    margin-bottom: 20px;
    padding: 0 4px;
}
.uh-main-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    transition: color 0.2s, border-color 0.2s;
}
.uh-main-tab.active, .uh-main-tab:hover {
    color: #2c3e50;
    border-bottom-color: #3498db;
}
.uh-main-tab.active { color: #3498db; }

/* ===== PROFILE TABS ===== */
.uh-profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e0e7ef;
    margin-bottom: 18px;
}
.uh-profile-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #7f8c8d;
    transition: color 0.2s, border-color 0.2s;
}
.uh-profile-tab.active { color: #3498db; border-bottom-color: #3498db; }

/* ===== OUTLINE BUTTON ===== */
.uh-btn-outline {
    background: transparent;
    border: 1.5px solid #3498db;
    color: #3498db;
}
.uh-btn-outline:hover { background: #3498db; color: #fff; }

/* ===== DISABLED INPUT ===== */
.uh-input-disabled {
    background: #f0f4f8 !important;
    color: #95a5a6 !important;
    cursor: not-allowed;
}

/* ===== ROLE SELECT ===== */
.uh-role-select {
    padding: 4px 8px;
    border: 1.5px solid #dce3ea;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
}
.uh-role-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== SUB TITLE ===== */
.uh-sub-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    margin-top: 0;
}

/* ===== MUTED TEXT ===== */
.uh-muted { color: #bdc3c7; font-size: 12px; }
