:root {
    --primary: #2e7d32;
    --primary-light: #4caf50;
    --primary-dark: #1b5e20;
    --secondary: #ff9800;
    --light: #f5f5f5;
    --dark: #333;
    --gray: #757575;
    --gray-light: #e0e0e0;
    --danger: #d32f2f;
    --warning: #ffa000;
    --success: #388e3c;
    --info: #1976d2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
    color: white;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

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

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--secondary);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 1.5rem;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
}

.content {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.2rem;
    color: var(--primary);
}

.card-body {
    padding: 20px;
}

/* Dashboard Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-green .stat-icon {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--success);
}

.stat-yellow .stat-icon {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning);
}

.stat-red .stat-icon {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--danger);
}

.stat-blue .stat-icon {
    background-color: rgba(25, 118, 210, 0.1);
    color: var(--info);
}

/* Chart Container */
.chart-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.chart-card h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark);
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #f57c00;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--gray-light);
    color: var(--dark);
}

.btn-outline:hover {
    background-color: #f8f9fa;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.badge-green {
    background-color: rgba(46, 125, 50, 0.2);
    color: var(--success);
}

.badge-yellow {
    background-color: rgba(255, 152, 0, 0.2);
    color: var(--warning);
}

.badge-red {
    background-color: rgba(211, 47, 47, 0.2);
    color: var(--danger);
}

.badge-black {
    background-color: rgba(33, 33, 33, 0.2);
    color: var(--dark);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--gray);
}

.pagination-controls {
    display: flex;
    align-items: center;
}

.page-size-select {
    margin-right: 15px;
}

.page-numbers {
    display: flex;
}

.page-numbers button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-light);
    background-color: white;
    margin: 0 2px;
    cursor: pointer;
    border-radius: 4px;
}

.page-numbers button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Filter Styles */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-item {
    flex: 1;
    min-width: 150px;
}

/* Auto-suggest Styles */
.autosuggest-container {
    position: relative;
}

.autosuggest-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid var(--gray-light);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.autosuggest-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-light);
}

.autosuggest-item:hover {
    background-color: #f5f5f5;
}

/* Tab Styles */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-light);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
    }

    .sidebar-menu {
        padding: 10px 0;
    }

    .sidebar-menu ul {
        display: flex;
        overflow-x: auto;
    }

    .sidebar-menu li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sidebar-menu a {
        padding: 10px 15px;
    }

    .chart-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px;
    }

    .content {
        padding: 15px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
    }

    .col {
        margin-bottom: 15px;
    }

    .filter-container {
        flex-direction: column;
    }
}

/* Color coding for scores */
.score-4 {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--success);
    font-weight: bold;
    text-align: center;
}

.score-3 {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--warning);
    font-weight: bold;
    text-align: center;
}

.score-2 {
    background-color: rgba(211, 47, 47, 0.1);
    color: var(--danger);
    font-weight: bold;
    text-align: center;
}

.score-1 {
    background-color: rgba(33, 33, 33, 0.1);
    color: var(--dark);
    font-weight: bold;
    text-align: center;
}

.score-0 {
    background-color: #f5f5f5;
    color: var(--gray);
    text-align: center;
}

.total-score-green {
    background-color: rgba(46, 125, 50, 0.2);
    font-weight: bold;
}

.total-score-yellow {
    background-color: rgba(255, 152, 0, 0.2);
    font-weight: bold;
}

.total-score-red {
    background-color: rgba(211, 47, 47, 0.2);
    font-weight: bold;
}

.total-score-black {
    background-color: rgba(33, 33, 33, 0.2);
    font-weight: bold;
}

/* Page / Tab visibility */
.page { display: none; }
.page.active { display: block; }

.tab-content { display: none; }
.tab-content.active { display: block; }

  /* Minggu: warna pink lembut */
  .sun-pink { background:#ffd1e6; }
  /* Sel matrik menampung badge di tengah */
  .cell-score { position:relative; min-width: 36px; text-align:center; }
  .cell-score .badge { 
    position:absolute; inset:2px; 
    display:flex; align-items:center; justify-content:center;
    z-index:1;
  }
  /* Teks nilai tetap ada tapi tidak terlihat (untuk kebutuhan data) */
  .score-text { opacity: 0; }


/* Embedded page (Download -> konv/index.html) */
.embed-loading{
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  background: #fff;
}
.embed-loading .spinner{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(0,0,0,.15);
  border-top-color: rgba(0,0,0,.5);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg); } }
/* Embedded Download (iframe) */
.embed-body{
  padding: 0 !important;
  height: calc(100vh - 190px); /* header + spacing */
  min-height: 70vh;
  position: relative;
  display: flex;
}
.embed-loading{
  position: absolute;
  inset: 0;
  z-index: 2;
}
.embed-frame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
  flex: 1;
}
@media (max-width: 768px){
  .embed-body{ height: calc(100vh - 220px); }
}


/* Quick access button & modal */
.quick-access-btn{
  position:fixed;
  left:20px;
  bottom:20px;
  width:56px;
  height:56px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--primary),var(--primary-dark));
  color:#fff;
  box-shadow:0 10px 22px rgba(0,0,0,.18);
  z-index:2100;
  cursor:pointer;
  font-size:1.1rem;
}
.quick-access-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2200;
  padding:16px;
}
.quick-access-card{
  width:min(420px,100%);
  background:#fff;
  border-radius:16px;
  padding:18px;
  box-shadow:0 18px 36px rgba(0,0,0,.22);
}
.quick-access-title{ font-size:1.1rem; font-weight:700; color:var(--primary); margin-bottom:6px; }
.quick-access-text{ color:var(--gray); margin-bottom:14px; }
.quick-access-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }

/* Quick input page */
.quick-input-layout{ display:flex; flex-direction:column; gap:18px; }
.quick-grid-2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.quick-panel{
  border:1px solid #e7eaee;
  border-radius:16px;
  padding:16px;
  background:#fff;
}
.quick-section-title{ font-weight:700; color:var(--primary); margin-bottom:12px; }
.quick-muted{ color:var(--gray); font-size:.95rem; margin-bottom:10px; }
.quick-chip-wrap{ display:flex; flex-wrap:wrap; gap:10px; }
.quick-chip{
  border:1px solid #d8dee6;
  background:#fff;
  border-radius:999px;
  padding:10px 14px;
  cursor:pointer;
  transition:.18s ease;
}
.quick-chip:hover{ transform:translateY(-1px); box-shadow:0 8px 18px rgba(0,0,0,.06); }
.quick-chip.active{ background:var(--primary); color:#fff; border-color:var(--primary); }
.quick-participant-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:10px; }
.quick-participant-card{
  border:1px solid #e1e7ee;
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  background:#fff;
  transition:.18s ease;
}
.quick-participant-card:hover{ transform:translateY(-1px); box-shadow:0 8px 18px rgba(0,0,0,.05); }
.quick-participant-card.active{ border-color:var(--primary); box-shadow:0 0 0 2px rgba(46,125,50,.12); background:#f4fbf5; }

.quick-participant-card.picked-1{ background:#fff5f7; border-color:#f8c9d2; }
.quick-participant-card.picked-2{ background:#ffe9ee; border-color:#f3aebb; }
.quick-participant-card.picked-3{ background:#ffd9e1; border-color:#ea8ea1; }
.quick-participant-card.picked-4{ background:#ffc7d2; border-color:#df6f88; }
.quick-participant-card.picked-5{ background:#ffb3c2; border-color:#d65876; }
.quick-participant-card.picked .q-name::after{
  content:' • sudah dipilih';
  font-size:.78rem;
  font-weight:600;
  color:#b14b63;
}
.quick-participant-card[data-picked-count="2"] .q-name::after,
.quick-participant-card[data-picked-count="3"] .q-name::after,
.quick-participant-card[data-picked-count="4"] .q-name::after,
.quick-participant-card[data-picked-count="5"] .q-name::after{
  content:' • ' attr(data-picked-count) 'x dipilih';
}
.quick-participant-card.active.picked{ box-shadow:0 0 0 2px rgba(214,88,118,.18); }
.quick-participant-card .q-name{ font-weight:700; color:#223; }
.quick-participant-card .q-meta{ color:var(--gray); font-size:.9rem; }
.quick-calendar{
  border:1px solid #eef1f4;
  border-radius:14px;
  overflow:hidden;
  background:#fcfcfd;
}
.quick-cal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid #eef1f4;
  background:#fff;
}
.quick-cal-title{ font-weight:700; color:#223; }
.quick-cal-nav{ display:flex; gap:6px; }
.quick-cal-nav button{
  width:34px; height:34px; border:1px solid #dde4ea; background:#fff; border-radius:10px; cursor:pointer;
}
.quick-cal-weekdays, .quick-cal-days{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
  padding:10px;
}
.quick-cal-weekdays div{ text-align:center; color:var(--gray); font-size:.85rem; font-weight:600; }
.quick-day{
  min-height:42px;
  border:1px solid #edf1f5;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}
.quick-day.muted{ color:#b8c0c7; background:#fafbfc; }
.quick-day.today{ border-color:#c8e6c9; }
.quick-day.active{ background:var(--primary); color:#fff; border-color:var(--primary); }
.time-grid{ display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; }
.time-grid button{
  min-height:42px;
  border:1px solid #dde3ea;
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  font-weight:700;
}
.time-grid button.active{ background:var(--primary); color:#fff; border-color:var(--primary); }
.quick-summary{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:10px;
}
.quick-summary-item{
  border:1px solid #e7eaee;
  border-radius:14px;
  padding:12px;
  background:#fafcfa;
}
.quick-summary-label{ font-size:.82rem; color:var(--gray); margin-bottom:4px; }
.quick-summary-value{ font-weight:700; color:#223; }

@media (max-width: 900px){
  .quick-grid-2{ grid-template-columns:1fr; }
  .time-grid{ grid-template-columns:repeat(4,minmax(0,1fr)); }
}
