/*
 * CRUD aug 2026
 * filename: ncrd_css.css
 * files called: none
 * files calling this: ncrd_main.php
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333;
    margin:0;
    padding: 0px; /* Minimal page margin */
}

.container {
    max-width: 100%;
    margin: 0 ;
    padding: 0px; 
}

/* Header Banner */
.banner {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #2c3e50;
    margin-bottom: 1px;
    padding: 0px 0px; /* Ultra-low banner padding */
    background: #ffffff;
    border-radius: 0px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

/* Control Panel Grid */
.control-panel {
    background: #ffffff;
    padding: 1px 1px; /* Ultra-low control panel padding */
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 0px;
}

.row-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
    margin-bottom: 1px;
}

.row-cluster:last-child {
    margin-bottom: 0;
}

.col {
    display: flex;
    align-items: center;
    gap: 2px;
}

label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #4a5568;
}

select, input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"] {
    padding: 1px 3px; /* Minimal input padding */
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
    height: 24px;
}

select:focus, input:focus {
    border-color: #3182ce;
}

input:disabled, select:disabled {
    background-color: #edf2f7;
    cursor: not-allowed;
}

.btn {
    padding: 2px 8px; /* Minimal button padding */
    border: none;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    height: 24px;
    line-height: 1;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary { background: #3182ce; color: white; }
.btn-primary:hover { background: #2b6cb0; }

.btn-secondary { background: #718096; color: white; }
.btn-secondary:hover { background: #4a5568; }

.btn-danger { background: #e53e3e; color: white; }
.btn-danger:hover { background: #c53030; }

.btn-success { background: #38a169; color: white; }
.btn-success:hover { background: #2f855a; }

.field-checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 1px;
    max-height: 48px; /* Compact box height */
    overflow-y: auto;
    padding: 2px 6px; /* Ultra-low inner padding */
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #f7fafc;
    flex: 1;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
}

/* Data Table Container */
.table-container {
    background: #ffffff;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: auto;
    border: 1px solid #e2e8f0;
}

.crud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.crud-table th {
    position: sticky;
    top: 0;
    background: #2d3748;
    color: #ffffff;
    padding: 2px 3px; /* Minimal header height */
    white-space: nowrap;
    z-index: 2;
}

.sort-icon {
    cursor: pointer;
    margin-left: 4px;
    user-select: none;
    color: #a0aec0;
}

.sort-icon.active {
    color: #63b3ed;
}

.crud-table td {
    padding: 1px 3px; /* Minimal row height */
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #edf2f7;
}

.crud-table tr:hover {
    background-color: #f7fafc;
}

.editable-cell {
    cursor: pointer;
}

.editable-cell:hover {
    background-color: #ebf8ff;
}

.editable-cell input, .editable-cell select, .editable-cell textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 1px 3px;
    height: 22px;
}

/* Pagination & Action Bar */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #edf2f7;
    padding: 1px 2px; /* Minimal pagination padding */
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 3px 3px;
    font-size: 0.78rem;
}

.pagination-controls {
    display: flex;
    gap: 3px;
}

.add-record-panel {
    margin-top: 4px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: #ffffff;
    padding: 3px 4px;
    border-radius: 4px;
    width: 450px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.modal-header {
    font-size: 0.95rem;
    font-weight: bold;
    margin-bottom: 6px;
    color: #2d3748;
}

.form-group {
    margin-bottom: 3px;
}

.form-group label {
    display: block;
    margin-bottom: 2px;
    font-size: 0.78rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 10px;
}