/* ===================================================
   GLOBAL RESET & BASE
=================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --yellow: #f5c400;
    --yellow-dark: #e0b000;
    --dark: #1f1f1f;
    --gray: #f4f4f4;
    --border: #ddd;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray);
    color: #222;
}

/* ===================================================
   WRAPPER & LAYOUT
=================================================== */
.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    display: flex;
    flex: 1;
}

/* ===================================================
   HEADER
=================================================== */
header {
    background: var(--yellow);
    color: #000;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

header .logo {
    font-size: 20px;
}

header .user {
    font-size: 13px;
    background: #fff;
    padding: 6px 10px;
    border-radius: 20px;
}

/* ===================================================
   SIDEBAR / NAV
=================================================== */
.sidebar {
    width: 230px;
    background: var(--dark);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar a {
    color: #fff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--yellow);
    color: #000;
}

/* ===================================================
   CONTENT AREA
=================================================== */
.content {
    flex: 1;
    padding: 25px;
}

/* ===================================================
   CARDS
=================================================== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.card h2 {
    margin-bottom: 15px;
}

/* ===================================================
   FORMS
=================================================== */
form {
    width: 100%;
}

input, select, textarea, button {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--yellow);
}

button {
    background: var(--yellow);
    border: none;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: var(--yellow-dark);
}

/* ===================================================
   TABLES
=================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: var(--yellow);
    color: #000;
    padding: 10px;
    text-align: left;
}

td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: #fafafa;
}

/* ===================================================
   FIELD SELECTION (ADMIN)
=================================================== */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
}

.field-item {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.field-item strong {
    display: block;
    margin-bottom: 10px;
}

.toggle-group {
    display: flex;
    gap: 15px;
}

/* Custom checkbox */
.toggle-group input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--yellow);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.toggle-group input[type="checkbox"]:checked {
    background: var(--yellow);
}

.toggle-group input[type="checkbox"]:checked::after {
    content: "✓";
    color: #000;
    position: absolute;
    top: -2px;
    left: 3px;
    font-size: 14px;
}

/* ===================================================
   ALERTS / MESSAGES
=================================================== */
.msg {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.msg.ok {
    background: #d4f8d4;
    color: #0b6b0b;
}

.msg.err {
    background: #f8d4d4;
    color: #8a0000;
}

/* ===================================================
   PAGINATION
=================================================== */
.pager {
    margin-top: 15px;
}

.pager a {
    padding: 6px 10px;
    background: var(--yellow);
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 6px;
}

/* ===================================================
   FOOTER
=================================================== */
footer {
    background: var(--dark);
    color: #fff;
    text-align: center;
    font-size: 13px;
    padding: 12px;
}

/* ===================================================
   LOGIN / REGISTER PAGES
=================================================== */
.auth-box {
    max-width: 400px;
    margin: 80px auto;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 20px;
}

/* ===================================================
   RESPONSIVE (MOBILE)
=================================================== */
@media (max-width: 768px) {

    .main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sidebar a {
        flex: 1 1 40%;
        text-align: center;
    }

    .content {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }
}
