/* assets/css/style.css (New Version) */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;700&display=swap');

:root {
    --primary-color: #2980b9;
    --secondary-color: #3498db;
    --light-color: #ffffff;
    --dark-color: #333333;
    --grey-color: #7f8c8d;
    --light-grey-color: #f8f9fa;
    --border-color: #dee2e6;
    --success-color: #27ae60;
    --error-color: #c0392b;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--light-grey-color);
    color: var(--dark-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
}

/* Card Style */
.card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h1, .card-header h2 {
    margin: 0;
    font-weight: 500;
}

.card-body {
    padding: 30px;
}

/* Form Styling */
fieldset {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}
legend {
    padding: 0 10px;
    font-weight: 500;
    color: var(--primary-color);
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.2);
}

input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

select[disabled] {
     background-color: #f5f5f5;
     cursor: not-allowed;
}

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

/* Button Styling */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--light-color);
}
.btn-primary:hover {
    background-color: #2471a3;
}

.btn-secondary {
    background-color: var(--grey-color);
    color: var(--light-color);
}
.btn-secondary:hover {
    background-color: #717d7e;
}

.btn-danger {
    background-color: var(--error-color);
    color: var(--light-color);
}
.btn-danger:hover {
    background-color: #a93226;
}

.btn:active {
    transform: translateY(1px);
}

/* Item List Styling */
.item-row {
    display: grid;
    grid-template-columns: 4fr 1fr 1.5fr 3fr auto;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--light-grey-color);
    border-radius: var(--border-radius);
}
.item-row:nth-child(even) {
    background-color: #fafafa;
}

.remove-item-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    line-height: 1;
}
.remove-item-btn:hover {
    color: #e74c3c;
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 30px 0;
}

/* Table Styling */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.styled-table thead tr {
    background-color: var(--primary-color);
    color: var(--light-color);
    text-align: left;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
}

.styled-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: var(--light-grey-color);
}

.styled-table tbody tr:last-of-type {
    border-bottom: 2px solid var(--primary-color);
}

.styled-table tbody tr:hover {
    background-color: #d4e6f1;
}

.styled-table a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.styled-table a:hover {
    text-decoration: underline;
}

/* Admin Login */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.login-container h2 {
    margin-bottom: 20px;
}
.login-container .error {
    color: var(--error-color);
    background-color: #f5b7b1;
    padding: 10px;
    border-radius: var(--border-radius);
    margin-top: 15px;
}
