/* Laptop Ministry Accounting - Custom Styles */

/* Status messages */
.success { color: #006600; font-weight: bold; padding: 5px 0; }
.error { color: #cc0000; font-weight: bold; padding: 5px 0; }
.warning { color: #cc6600; font-weight: bold; padding: 5px 0; }

/* Data tables — fit to screen, allow multiline cells */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 2px solid #808080;
    margin-top: 10px;
    font-size: 12px;
    table-layout: fixed;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
table.data-table th,
table.data-table td {
    border: 1px solid #a0a0a0;
    padding: 4px 5px;
    text-align: left;
    vertical-align: top;
    white-space: normal;
    overflow: hidden;
}
table.data-table th {
    background: #e0e0e0;
    border-bottom: 2px solid #808080;
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
}
table.data-table tr:nth-child(even) {
    background: #f4f4f4;
}
table.data-table tr:hover {
    background: #d8e8f8;
}

/* Column widths for waitlist (16 cols) */
table.data-table.wl-table { table-layout: fixed; }
table.data-table.wl-table col.col-num   { width: 3%; }
table.data-table.wl-table col.col-name  { width: 7%; }
table.data-table.wl-table col.col-contact { width: 8%; }
table.data-table.wl-table col.col-date  { width: 6%; }
table.data-table.wl-table col.col-yn    { width: 3%; }
table.data-table.wl-table col.col-invid { width: 4%; }
table.data-table.wl-table col.col-desc  { width: 12%; }
table.data-table.wl-table col.col-os    { width: 6%; }
table.data-table.wl-table col.col-need  { width: 14%; }
table.data-table.wl-table col.col-notes { width: 10%; }
table.data-table.wl-table col.col-actions { width: 6%; }

/* Column widths for inventory (11 cols) */
table.data-table.inv-table { table-layout: fixed; }
table.data-table.inv-table col.col-id     { width: 5%; }
table.data-table.inv-table col.col-edate  { width: 9%; }
table.data-table.inv-table col.col-rdate  { width: 8%; }
table.data-table.inv-table col.col-donor  { width: 10%; }
table.data-table.inv-table col.col-dcontact { width: 10%; }
table.data-table.inv-table col.col-yn     { width: 4%; }
table.data-table.inv-table col.col-val    { width: 5%; }
table.data-table.inv-table col.col-desc   { width: 24%; }
table.data-table.inv-table col.col-notes  { width: 14%; }
table.data-table.inv-table col.col-actions { width: 7%; }

/* Truncated cells show full text on hover */
table.data-table td[title] {
    cursor: default;
}

/* Scrollable table wrapper — only for import preview */
.table-scroll {
    overflow-x: auto;
    margin-top: 10px;
}

/* Import preview styles */
table.preview-table tr.row-valid {
    background: #e8f5e9;
}
table.preview-table tr.row-invalid {
    background: #ffebee;
}
table.preview-table td.cell-error {
    color: #cc0000;
    font-weight: bold;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0;
}
.stat-box {
    background: #e0e0e0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 12px;
    text-align: center;
}
.stat-box .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #000080;
}
.stat-box .stat-label {
    font-size: 12px;
    color: #444;
    margin-top: 4px;
}

/* Quick links */
.quick-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}
.quick-links a {
    display: inline-block;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 6px 14px;
    text-decoration: none;
    color: #000;
    font-size: 13px;
}
.quick-links a:hover {
    background: #000080;
    color: #fff;
}
.quick-links a:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

/* Form improvements */
.form-row {
    margin-bottom: 8px;
}
.form-row label {
    display: block;
    margin-bottom: 3px;
    font-weight: bold;
    font-size: 13px;
}
.form-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}
.form-inline .form-row {
    flex: 1;
    min-width: 140px;
}

/* Action buttons in tables */
.action-btns {
    white-space: nowrap;
}
.action-btns form {
    display: inline;
    margin: 0;
}
.action-btns button {
    font-size: 12px;
    padding: 2px 8px;
    margin: 1px;
}
.btn-danger {
    color: #cc0000;
}

/* Popup/modal overlay for edit forms */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-content {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.4);
}

/* Import file upload area */
.upload-area {
    border: 2px dashed #808080;
    padding: 20px;
    text-align: center;
    margin: 10px 0;
    background: #e8e8e8;
}
.upload-area input[type="file"] {
    margin: 10px 0;
}

/* Login page stats layout */
.login-stats-wrapper {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
}
.login-stats-wrapper .login-container {
    width: 100%;
    max-width: 350px;
    margin: 30px auto 20px;
}
.login-stats-wrapper h2 {
    background: #000080;
    color: #fff;
    padding: 5px 10px;
    margin: 18px 0 8px;
    font-size: 15px;
}
.login-stats-wrapper .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}
.login-stats-wrapper .stat-box {
    padding: 8px;
}
.login-stats-wrapper .stat-box .stat-value {
    font-size: 20px;
}
.login-stats-wrapper .stat-box .stat-label {
    font-size: 11px;
}

/* Progress bars */
.progress-row {
    margin: 6px 0;
}
.progress-row .progress-label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
}
.progress-bar-track {
    width: 100%;
    height: 18px;
    background: #e0e0e0;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
}
.progress-bar-fill {
    height: 100%;
    background: #000080;
    transition: width 0.3s;
}
.progress-bar-fill.bar-green { background: #006600; }
.progress-bar-fill.bar-orange { background: #cc6600; }
.progress-bar-fill.bar-blue { background: #000080; }

/* Monthly breakdown table on login */
table.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 6px 0;
    background: #fff;
    border: 1px solid #a0a0a0;
}
table.mini-table th, table.mini-table td {
    border: 1px solid #c0c0c0;
    padding: 3px 6px;
    text-align: center;
}
table.mini-table th {
    background: #e0e0e0;
}

.footer-credit {
    text-align: center;
    font-size: 11px;
    color: #666;
    margin: 15px 0 10px;
    padding-top: 8px;
    border-top: 1px solid #a0a0a0;
}

/* Responsive sidebar */
@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #808080;
    }
    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
    }
    .sidebar nav a {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    table.data-table {
        font-size: 12px;
    }
    table.data-table th,
    table.data-table td {
        padding: 4px;
    }
}
