@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
    /* Syngenta brand palette */
    --primary:      #00E6BE;   /* Sky Blue  */
    --primary-dark: #000000;   /* Black     */
    --primary-mid:  #50E600;   /* Leaf Green */
    --primary-light:#ccfaf4;   /* Sky Blue tint */
    --accent:       #FFAA00;   /* Sun Orange */
    --danger:       #FF0064;   /* Cherry Pink */
    --danger-light: #ffe0ef;
    --bg:           #ECEAE6;   /* Warm Gray 1 */
    --surface:      #ffffff;
    --border:       #d5d3cf;
    --text:         #1a1918;
    --text-muted:   #5a5957;
    --text-subtle:  #9b9a96;
    --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:       0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:    0 10px 30px rgba(0,0,0,0.09), 0 4px 8px rgba(0,0,0,0.05);
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    14px;
    --transition:   150ms ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ──────────────────────────────────────────────── */
body {
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────── */
header {
    background: var(--primary-dark);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
header h1 {
    text-align: center;
    font-size: clamp(1rem, 3.5vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0 2.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-link {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: inherit;
    line-height: 0;
    border-radius: var(--radius-sm);
    padding: 0.2rem;
    transition: opacity var(--transition);
}
.header-link:hover { opacity: 0.7; }

/* ── Layout ────────────────────────────────────────────── */
.container {
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1.25rem;
    flex: 1;
}

/* ── Card (section panel) ──────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

/* ── Card / section heading ────────────────────────────── */
.card h2,
.section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.4rem;
    margin-bottom: 1.25rem;
}

/* ── Form elements ─────────────────────────────────────── */
label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

select,
input[type="text"],
input[type="number"],
input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    margin-bottom: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}
select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 190, 0.25);
}

/* ── Buttons ───────────────────────────────────────────── */
button {
    padding: 0.55rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}
button:hover  { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
button:active { transform: translateY(0); box-shadow: none; }

.btn-primary { background: var(--primary);     color: var(--primary-dark); }
.btn-success { background: var(--primary-mid); color: var(--primary-dark); }
.btn-danger  { background: var(--danger);      color: white; }
.btn-sm      { font-size: 0.76rem; padding: 0.3rem 0.7rem; }

/* ── Notifications ─────────────────────────────────────── */
.msg {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-left: 3px solid;
    display: none;
}
.msg.ok  { background: var(--primary-light); color: var(--primary-dark); border-color: var(--primary); }
.msg.err { background: var(--danger-light);  color: var(--danger);       border-color: var(--danger); }

/* ── Tables ────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.72rem, 2vw, 0.84rem);
    background: var(--surface);
}
th {
    background: var(--primary-dark);
    color: white;
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f0efec; }


/* ── Back to top ───────────────────────────────────────── */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    z-index: 200;
}
#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}
#back-to-top:hover {
    background: var(--primary-mid);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
#back-to-top:active { transform: translateY(0); }

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 640px) {
    header          { padding: 0.85rem 1rem; }
    header h1       { padding: 0 1.75rem; }
    .header-link    { right: 1rem; }
    .container      { padding: 0 0.75rem; margin: 1rem auto; }
    .card           { padding: 1.1rem; border-radius: var(--radius); }
}
