/* ============================================================
   TiCi Nature Lab - Admin Panel Stylesheet
   ============================================================ */

:root {
    --green-deep:   #1a3d2b;
    --green-mid:    #2d6a4f;
    --green-light:  #52b788;
    --green-pale:   #d8f3dc;
    --earth:        #8b5e3c;
    --earth-light:  #f0e6d3;
    --gold:         #c9a84c;
    --white:        #ffffff;
    --off-white:    #f8faf9;
    --text-dark:    #1c2b22;
    --text-mid:     #4a6358;
    --text-light:   #8fa99e;
    --border:       #e0ece5;
    --sidebar-w:    260px;
    --topbar-h:     64px;
    --shadow-sm:    0 1px 4px rgba(26,61,43,0.08);
    --shadow-md:    0 4px 16px rgba(26,61,43,0.12);
    --shadow-lg:    0 8px 32px rgba(26,61,43,0.16);
    --radius-sm:    6px;
    --radius-md:    12px;
    --radius-lg:    20px;
    --transition:   0.22s ease;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
}

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--green-deep);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    font-size: 28px;
    background: var(--green-mid);
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.brand-text strong {
    display: block;
    color: var(--white);
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    line-height: 1.3;
}

.brand-text small {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-group-label {
    padding: 14px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    font-size: 14px;
    font-weight: 400;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

.nav-item.active {
    color: var(--green-light);
    background: rgba(82,183,136,0.12);
    border-left-color: var(--green-light);
    font-weight: 500;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.admin-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--green-light);
    color: var(--green-deep);
    font-size: 14px;
    font-weight: 700;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.admin-info {
    overflow: hidden;
}

.admin-info strong {
    display: block;
    color: var(--white);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-info small {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
}

.btn-logout {
    color: rgba(255,255,255,0.4);
    font-size: 18px;
    text-decoration: none;
    transition: color var(--transition);
    padding: 4px;
}

.btn-logout:hover { color: #ff8080; }

/* ---- MAIN WRAPPER ---- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin var(--transition);
}

/* ---- TOPBAR ---- */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 36px; height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-mid);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-toggle:hover {
    background: var(--green-pale);
    border-color: var(--green-light);
    color: var(--green-deep);
}

.topbar-title {
    flex: 1;
}

.topbar-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--green-deep);
    line-height: 1.2;
}

.topbar-sub {
    font-size: 12px;
    color: var(--text-light);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: var(--text-mid);
    text-decoration: none;
    font-size: 16px;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--green-pale);
    border-color: var(--green-light);
    color: var(--green-deep);
}

/* ---- FLASH ---- */
.flash-wrap {
    padding: 16px 24px 0;
}

.flash-wrap .alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
}

.flash-wrap .alert i { margin-right: 8px; }

/* ---- PAGE CONTENT ---- */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ---- CARDS ---- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
}

.card-header h5, .card-header h6 {
    font-family: 'Playfair Display', serif;
    color: var(--green-deep);
    margin: 0;
}

.card-body { padding: 20px; }

/* ---- STAT CARDS ---- */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.green  { background: var(--green-pale); color: var(--green-mid); }
.stat-icon.earth  { background: var(--earth-light); color: var(--earth); }
.stat-icon.gold   { background: #fef9e7; color: var(--gold); }
.stat-icon.blue   { background: #e8f4fd; color: #2980b9; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    color: var(--green-deep);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ---- TABLES ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.admin-table thead th {
    background: var(--off-white);
    padding: 12px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--text-mid);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-dark);
}

.admin-table tbody tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover { background: var(--off-white); }

/* ---- BUTTONS ---- */
.btn-primary {
    background: var(--green-mid);
    border-color: var(--green-mid);
    color: white;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-primary:hover {
    background: var(--green-deep);
    border-color: var(--green-deep);
    color: white;
}

.btn-outline-primary {
    color: var(--green-mid);
    border-color: var(--green-mid);
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--green-mid);
    color: white;
}

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- FORMS ---- */
.form-label {
    font-weight: 500;
    color: var(--text-mid);
    font-size: 13px;
    margin-bottom: 5px;
}

.form-control, .form-select {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
}

.form-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    background: var(--white);
}

.form-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: var(--green-deep);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- BADGE ---- */
.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ---- WORKSHOP CARD ---- */
.workshop-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
    transition: box-shadow var(--transition), transform var(--transition);
}

.workshop-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.workshop-card-img {
    height: 160px;
    background: linear-gradient(135deg, var(--green-deep), var(--green-mid));
    position: relative;
    overflow: hidden;
}

.workshop-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.workshop-card-img .status-pill {
    position: absolute;
    top: 12px; right: 12px;
}

.workshop-card-body { padding: 16px; }

.workshop-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    color: var(--green-deep);
    margin-bottom: 8px;
}

.workshop-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.workshop-card-meta span { display: flex; align-items: center; gap: 4px; }

.workshop-card-footer {
    padding: 12px 16px;
    background: var(--off-white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---- QR SCANNER ---- */
.scanner-box {
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.scan-frame {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scan-frame::before {
    content: '';
    width: 60%; height: 60%;
    border: 3px solid var(--green-light);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
}

/* ---- UTILITIES ---- */
.text-green   { color: var(--green-mid); }
.text-earth   { color: var(--earth); }
.bg-green-pale { background: var(--green-pale); }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-light); font-weight: 600; }
.divider { border-color: var(--border); margin: 20px 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; }
.avatar-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--green-pale);
    color: var(--green-mid);
    font-weight: 700;
    font-size: 15px;
    display: grid;
    place-items: center;
}

/* ---- MOBILE ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 991px) {
    .sidebar-toggle { display: flex; }
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .sidebar-overlay.show { display: block; }
    .main-wrapper { margin-left: 0; }
}

@media (max-width: 576px) {
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stat-value { font-size: 22px; }
    .topbar-title h1 { font-size: 17px; }
}

/* ---- PRINT (Certificates) ---- */
@media print {
    .sidebar, .topbar, .topbar-actions, .sidebar-toggle { display: none !important; }
    .main-wrapper { margin-left: 0; }
}

/* ---- PUBLIC SITE ---- */
.pub-header {
    background: var(--green-deep);
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.pub-nav {
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 64px;
    gap: 20px;
}

.pub-brand {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.pub-nav-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 14px;
    padding: 0 12px;
    transition: color var(--transition);
}

.pub-nav-links a:hover { color: var(--white); }

.pub-hero {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 60%, var(--green-light) 100%);
    padding: 80px 24px;
    text-align: center;
    color: var(--white);
}

.pub-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 5vw, 52px);
    margin-bottom: 16px;
}

.pub-hero p { font-size: 18px; opacity: 0.85; margin-bottom: 32px; }

.pub-workshop-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
    transition: box-shadow 0.25s, transform 0.25s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.pub-workshop-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    color: inherit;
}

.pub-footer {
    background: var(--green-deep);
    color: rgba(255,255,255,0.6);
    padding: 30px 24px;
    text-align: center;
    font-size: 13px;
    margin-top: 60px;
}
