:root {
    --primary: #1a6b3c;
    --primary-dark: #0d4a28;
    --primary-light: #e8f5e9;
    --accent: #ff9800;
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-muted: #6c757d;
    --border: #e0e0e0;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
}

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

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 230px;
    height: 100vh;
    background: var(--primary);
    color: white;
    padding-top: 0;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background: var(--primary-dark);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.sidebar-header p {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-header .brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 6px;
    background: #fff;
    padding: 4px;
}

.sidebar nav { padding: 10px 0; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left: 4px solid var(--accent);
}

.sidebar nav a .icon {
    display: inline-flex;
    width: 20px;
    text-align: center;
    vertical-align: middle;
}

.nav-svg {
    vertical-align: middle;
}

/* MAIN CONTENT */
.main {
    margin-left: 230px;
    padding: 20px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.topbar h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-dark);
}

.topbar .actions { display: flex; gap: 10px; }

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary);
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.stat-card.green { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--accent); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.blue { border-left-color: var(--info); }

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

table thead th {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary);
}

table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

table tbody tr:hover { background: #f8f9fa; }

table .text-right { text-align: right; }
table .text-center { text-align: center; }

tfoot td {
    padding: 10px 12px;
    font-weight: 700;
    border-top: 2px solid var(--primary);
    background: var(--primary-light);
}

/* FORM */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
}

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

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    font-family: inherit;
}

.btn:hover { opacity: 0.88; }

.btn-primary { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: #333; }
.btn-info { background: var(--info); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

/* BADGE */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-purple { background: #e6dbff; color: #5b21b6; }

.partners-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 18px 0; }
.partners-fieldset legend { font-weight: 700; padding: 0 8px; color: var(--text-muted); font-size: 13px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.hint { color: var(--text-muted); font-size: 12px; margin: 4px 0 10px; }
.mini-table { width: 100%; max-width: 520px; border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table .share-input { width: 110px; }

.topbar .actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--primary-light); border-radius: 20px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-meta strong { font-size: 12px; color: var(--text); }
.user-meta em { font-size: 10px; color: var(--text-muted); font-style: normal; }

/* FLASH */
.flash {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-weight: 500;
}

.flash-success { background: #d4edda; color: #155724; }
.flash-warning { background: #fff3cd; color: #856404; }
.flash-danger { background: #f8d7da; color: #721c24; }

/* UTILS */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* HAMBURGER for mobile */
.menu-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 22px;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-block; }
}

/* ===================== PRINT ===================== */
@media print {
    .sidebar, .menu-toggle, .no-print, .actions, .flash, form { display: none !important; }
    .main { margin-left: 0 !important; padding: 0 !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    .btn { display: none !important; }
    a { color: #000 !important; text-decoration: none !important; }
    table { width: 100% !important; }
}

