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

:root {
    --primary:       #1D9E75;
    --primary-dark:  #0F6E56;
    --primary-light: #E1F5EE;
    --danger:        #E24B4A;
    --danger-light:  #FCEBEB;
    --warning:       #EF9F27;
    --warning-light: #FAEEDA;
    --text:          #2C2C2A;
    --text-muted:    #5F5E5A;
    --text-hint:     #888780;
    --border:        #D3D1C7;
    --bg:            #F1EFE8;
    --surface:       #FFFFFF;
    --radius:        8px;
    --radius-lg:     12px;
    --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.page-wrap  { min-height: 100vh; display: flex; flex-direction: column; }

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: var(--shadow);
}
.navbar-brand {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: -0.2px;
}
.navbar-brand span { color: var(--text-muted); font-weight: 400; font-size: 13px; margin-left: 8px; }
.navbar-right { display: flex; align-items: center; gap: 16px; }
.navbar-role {
    font-size: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
    text-decoration: none;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn-primary   { background: var(--primary);      color: #fff; }
.btn-danger    { background: var(--danger);        color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm        { padding: 5px 11px; font-size: 13px; }
.btn-full      { width: 100%; justify-content: center; }

/* Forms */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s;
    appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }
.form-control:disabled { background: var(--bg); color: var(--text-muted); }
.form-hint { font-size: 12px; color: var(--text-hint); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-danger  { background: var(--danger-light);  color: #7a1e1e; border: 1px solid #f7c1c1; }
.alert-success { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #9FE1CB; }
.alert-warning { background: var(--warning-light); color: #633806; border: 1px solid #FAC775; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafaf8; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* Page content */
.page-content { padding: 28px 24px; flex: 1; }
.page-title   { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-desc    { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* Utility */
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--primary-dark); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.required::after { content: ' *'; color: var(--danger); }

/* Login page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}
.login-card { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--primary-dark); }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
