/* Admin Panel Specific Styles */
body.admin-body { /* You can add this class to body in admin.php if needed */
    background-color: #e9ecef;
}

.admin-main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-main h2 {
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Form Styling */
#add-edit-unit-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1; /* Span all columns */
}

.form-group label {
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="number"], /* If you use number type */
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.form-actions button {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    margin-left: 0.5rem;
    transition: background-color 0.2s ease;
}

.btn-save {
    background-color: #007bff;
    color: white;
}
.btn-save:hover {
    background-color: #0056b3;
}

.btn-clear {
    background-color: #6c757d;
    color: white;
}
.btn-clear:hover {
    background-color: #545b62;
}


/* Table Styling */
#manage-units-section {
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}
.table-container {
    overflow-x: auto; /* For responsive tables */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

th, td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

thead {
    background-color: #007bff;
    color: white;
}
thead th {
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
tbody tr:hover {
    background-color: #f1f1f1;
}

table button {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-right: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-edit {
    background-color: #ffc107;
    color: #212529;
    border-color: #ffc107;
}
.btn-edit:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}
.btn-delete:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Admin Messages */
.admin-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 5px;
    text-align: center;
}
.admin-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.admin-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}