:root {
    --primary-green: #2e7d32;
    --primary-blue: #1976d2;
    --light-green: #e8f5e9;
    --border-color: #c0c0c0;
    --text-color: #333;
    --header-bg: #1b5e20;
    --danger: #d32f2f;
    --warning: #fbc02d;
    --info: #2196f3;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

body {
    background-color: #f5f5f5;
    color: var(--text-color);
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* HEADER & USER PROFILE */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-green);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

#displayUserEmail {
    font-weight: bold;
    color: var(--primary-green);
    background: var(--light-green);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--primary-green);
    font-size: 12px;
}

.btn-logout {
    background-color: #757575;
    color: white;
    padding: 5px 10px;
    font-size: 11px;
}
.btn-logout:hover { background-color: #616161; }

/* LOGIN MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h2 { margin-bottom: 10px; color: var(--primary-green); border:none; }
.modal-content p { color: #666; margin-bottom: 20px; font-size: 13px; }

.login-form input {
    width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ccc;
    border-radius: 4px; font-size: 16px;
}

.btn-login {
    width: 100%; padding: 12px; background-color: var(--primary-green);
    color: white; border: none; border-radius: 4px; font-weight: bold;
    font-size: 14px; cursor: pointer;
}
.btn-login:hover { background-color: #1b5e20; }

.switch-auth { margin-top: 15px; font-size: 12px; }
.switch-auth a { color: var(--primary-blue); text-decoration: none; font-weight: bold; }
.switch-auth a:hover { text-decoration: underline; }

/* TABS */
.tabs { margin-bottom: 20px; border-bottom: 1px solid var(--border-color); display: flex; }
.tab-btn {
    padding: 10px 20px; background: #eee; border: 1px solid var(--border-color);
    border-bottom: none; margin-right: 5px; cursor: pointer; font-weight: bold;
    color: #555; border-radius: 4px 4px 0 0;
}
.tab-btn:hover { background: #ddd; }
.tab-btn.active {
    background: var(--light-green); color: var(--primary-green);
    border-top: 3px solid var(--primary-green); z-index: 10; position: relative;
}

/* TABLE */
.section { display: none; }
.section.active { display: block; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid var(--border-color); padding: 8px; text-align: left; vertical-align: middle; }
th {
    background-color: var(--header-bg); color: white; font-weight: 600;
    text-transform: uppercase; font-size: 11px;
}
tr:nth-child(even) { background-color: #fafafa; }
tr:hover { background-color: var(--light-green) !important; }

/* INPUT AREA */
.input-row td { background-color: #fff; padding: 5px; }
.input-actions { display: flex; gap: 5px; }
input[type="text"] {
    width: 100%; padding: 6px; border: 1px solid #999; outline: none; font-size: 13px;
}
input[type="text"]:focus {
    border-color: var(--primary-green); background-color: #fffde7;
}

/* BUTTONS */
.btn {
    padding: 6px 12px; border: none; cursor: pointer; font-size: 11px;
    border-radius: 2px; color: white; text-transform: uppercase; font-weight: bold;
    display: inline-block; flex: 1;
}
.btn-add { background-color: var(--primary-green); }
.btn-add:hover { background-color: #1b5e20; }
.btn-update { background-color: var(--primary-blue); }
.btn-update:hover { background-color: #0d47a1; }
.btn-cancel { background-color: #757575; flex: 0 0 auto; width: auto; }
.btn-cancel:hover { background-color: #616161; }

.action-group { display: flex; gap: 5px; }
.btn-action {
    padding: 5px 10px; font-size: 11px; color: white; display: inline-flex;
    align-items: center; justify-content: center; gap: 5px; border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: all 0.2s ease; flex: 1;
}
.btn-check { background-color: #fbc02d; color: #333; }
.btn-check:hover { background-color: #f9a825; transform: translateY(-1px); }
.btn-delete { background-color: #e53935; }
.btn-delete:hover { background-color: #c62828; transform: translateY(-1px); }
.btn-edit { background-color: var(--primary-blue); }
.btn-edit:hover { background-color: #0d47a1; transform: translateY(-1px); }

/* STATUS */
.status-cell { display: flex; align-items: center; justify-content: center; }
.status-dot {
    height: 10px; width: 10px; border-radius: 50%; display: inline-block;
    margin-right: 6px; box-shadow: 0 0 4px rgba(0,0,0,0.2);
}
.dot-green { background-color: #28a745; }
.dot-red { background-color: #dc3545; }
.dot-gray { background-color: #ccc; }
.dot-yellow { background-color: #fbc02d; }
.status-label { font-weight: 600; font-size: 11px; letter-spacing: 0.5px; }

/* ANIMATIONS */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.pulse { animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* TOAST */
#toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    background: #333; color: white; padding: 12px 20px; border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center;
    gap: 10px; font-size: 13px; min-width: 250px; opacity: 0;
    transform: translateX(50px); animation: slideIn 0.3s forwards;
}
.toast.success { border-left: 4px solid #28a745; }
.toast.info { border-left: 4px solid #2196f3; }
.toast.error { border-left: 4px solid #dc3545; }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(50px); } }

/* RESPONSIVE */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { position: absolute; top: -9999px; left: -9999px; }
    tr { border: 1px solid #ccc; margin-bottom: 10px; }
    td { border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 40%; }
    td:before { position: absolute; top: 6px; left: 6px; width: 35%; padding-right: 10px; white-space: nowrap; font-weight: bold; content: attr(data-label); }
    .action-group { margin-top: 10px; }
    .header-top { flex-direction: column; align-items: flex-start; gap: 10px; }
}