:root {
    --primary-color: #ff8fab;
    --primary-hover: #fb6f92;
    --secondary-color: #ffc2d1;
    --bg-color: #ffe5ec;
    --card-bg: rgba(255, 255, 255, 0.75);
    --text-main: #3d3d3d;
    --text-muted: #6c757d;
    --sidebar-bg: #fff;
    --border-color: rgba(255, 143, 171, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(255, 143, 171, 0.15);
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --info: #3498db;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 194, 209, 0.6) 0%, rgba(255, 229, 236, 1) 90%);
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 50px;
    padding: 0 10px;
}

.sidebar .logo i {
    font-size: 32px;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-links li:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.nav-links li.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 143, 171, 0.4);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 30px 40px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.greeting h1 {
    font-size: 28px;
    color: #2d3436;
}

.greeting p {
    color: var(--text-muted);
    margin-top: 5px;
}

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

.user-profile img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 143, 171, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 143, 171, 0.5);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid #ddd;
}

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

.btn-danger {
    background-color: #ffeaea;
    color: var(--danger);
    padding: 8px 12px;
    font-size: 14px;
}
.btn-danger:hover {
    background-color: var(--danger);
    color: white;
}

.btn-icon {
    padding: 8px 12px;
    font-size: 14px;
    background-color: #f1f3f5;
    color: var(--text-main);
}
.btn-icon:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Dashboard Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.kpi-card {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.kpi-icon.total-vol { background-color: rgba(255, 143, 171, 0.2); color: var(--primary-color); }
.kpi-icon.session-count { background-color: rgba(46, 204, 113, 0.2); color: var(--success); }
.kpi-icon.avg-vol { background-color: rgba(52, 152, 219, 0.2); color: var(--info); }
.kpi-icon.duration { background-color: rgba(241, 196, 15, 0.2); color: #d4ac0d; }

.kpi-details h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 5px;
}

.kpi-details h2 {
    font-size: 24px;
    color: #2d3436;
    font-weight: 700;
}

/* Charts and Recent */
.charts-section {
    margin-bottom: 30px;
}

.chart-card {
    padding: 25px;
}
.chart-container {
    height: 300px;
    width: 100%;
    margin-top: 20px;
}

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

.card-header h3 {
    font-size: 18px;
    color: #2d3436;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.view-all:hover {
    text-decoration: underline;
}

/* Recent Logs */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-radius: 12px;
    background-color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.8);
    transition: var(--transition);
}

.log-item:hover {
    background-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.log-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.log-date {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    min-width: 65px;
}

.log-date .day { font-size: 12px; font-weight: 600; text-transform: uppercase; }
.log-date .time { font-size: 16px; font-weight: 700; margin-top: 2px;}

.log-details h4 {
    font-size: 16px;
    color: #2d3436;
}
.log-details p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.log-amount {
    text-align: right;
}

.log-amount .volume {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}
.log-amount .duration {
    font-size: 13px;
    color: var(--text-muted);
}

/* History view */
.content-view.hidden {
    display: none;
}

.full-height {
    min-height: calc(100vh - 120px);
    padding: 25px;
}

.table-responsive {
    overflow-x: auto;
}

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

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

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: rgba(255,255,255,0.5);
}

.data-table tbody tr:hover {
    background-color: rgba(255,255,255,0.8);
}

.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-both { background-color: #e1bee7; color: #8e24aa; }
.badge-left { background-color: #b3e5fc; color: #0288d1; }
.badge-right { background-color: #ffccbc; color: #d84315; }

.table-actions {
    display: flex;
    gap: 10px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    padding: 30px;
    transform: translateY(20px);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.btn-close {
    background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted);
}
.btn-close:hover { color: var(--danger); }

/* Print Preview Specifics */
.print-modal {
    max-width: 800px; /* Lebar lebih besar untuk preview */
}

.preview-container {
    width: 100%;
    min-height: 300px;
    background-color: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
}

.preview-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Forms */
.form-row {
    display: flex;
    gap: 20px;
}
.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3436;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    background-color: rgba(255,255,255,0.8);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.2);
    background-color: #fff;
}

.input-with-icon {
    position: relative;
}
.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}
.input-with-icon .form-control {
    padding-left: 45px;
}

.radio-group {
    display: flex;
    gap: 15px;
}
.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}
.radio-card input {
    position: absolute;
    opacity: 0;
}
.radio-content {
    padding: 12px 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    transition: var(--transition);
    background-color: rgba(255,255,255,0.8);
}
.radio-card input:checked ~ .radio-content {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(255, 143, 171, 0.3);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--primary-color);
}
.toast.show {
    transform: translateX(0);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast i { font-size: 24px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }

/* Timer View */
.timer-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

.timer-setup, .timer-display {
    padding: 30px;
    height: 100%;
}

.mode-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.mode-card {
    position: relative;
    cursor: pointer;
}

.mode-card input {
    position: absolute;
    opacity: 0;
}

.mode-content {
    padding: 20px;
    border: 2px solid transparent;
    border-radius: 16px;
    background-color: rgba(255,255,255,0.6);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-content i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.mode-content h4 {
    font-size: 18px;
    color: #2d3436;
}

.mode-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.mode-card input:checked ~ .mode-content {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(255, 143, 171, 0.2);
}
.mode-card input:checked ~ .mode-content i {
    color: var(--primary-hover);
}

.phase-info {
    background: rgba(255,255,255,0.5);
    padding: 20px;
    border-radius: 12px;
}
.phase-info h4 {
    margin-bottom: 12px;
    font-size: 15px;
    color: #333;
}
.phase-info ul {
    list-style-position: inside;
    font-size: 14px;
    color: var(--text-muted);
}
.phase-info li {
    margin-bottom: 8px;
    padding-left: 5px;
}
.phase-info li.active-phase {
    color: var(--primary-color);
    font-weight: 600;
}

/* Custom Timer Settings */
.custom-settings {
    background: rgba(255, 143, 171, 0.06);
    border: 1px dashed rgba(255, 143, 171, 0.4);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-settings h4 {
    font-size: 14px;
    color: var(--primary-hover);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.custom-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 500;
}

.custom-field .form-control {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
}

.btn-apply-custom {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border-radius: 10px;
    background-color: rgba(255, 143, 171, 0.1);
    color: var(--primary-hover);
    border: 1px solid rgba(255, 143, 171, 0.3);
}
.btn-apply-custom:hover {
    background-color: var(--primary-color);
    color: white;
}

.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.phase-title {
    font-size: 28px;
    color: #2d3436;
    margin-bottom: 5px;
}

.phase-desc {
    font-size: 16px;
    margin-bottom: 40px;
}

.radial-timer {
    position: relative;
    width: 280px;
    height: 280px;
    margin-bottom: 40px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 143, 171, 0.2);
    stroke-width: 4;
}

.timer-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 6;
    stroke-dasharray: 283; /* 2 * PI * 45 */
    stroke-dashoffset: 283; /* Starts empty or full depending on logic */
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-progress.rest {
    stroke: var(--info); /* Blue for resting */
}

.timer-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-time {
    font-size: 54px;
    font-weight: 700;
    color: #2d3436;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.timer-total {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 10px;
    background: rgba(255, 143, 171, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.btn-icon-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding: 0;
}

.btn-play-pause {
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 30px;
}

.btn-play-pause i {
    font-size: 24px;
}

.w-100 {
    width: 100%;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar { width: 80px; padding: 20px 10px; }
    .sidebar .logo span { display: none; }
    .sidebar .logo i { margin: 0 auto; }
    .nav-links li span { display: none; }
    .nav-links li { justify-content: center; padding: 15px 0; }
    .main-content { margin-left: 80px; padding: 20px; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; padding: 10px 20px; display: block; }
    .sidebar .logo { margin-bottom: 10px; }
    .sidebar .logo i { margin: 0; }
    .sidebar .logo span { display: inline; }
    .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 5px;}
    .nav-links li { flex-direction: column; padding: 12px 10px; gap: 8px; text-align: center; margin-bottom: 0; }
    .nav-links li i { margin: 0; font-size: 22px; }
    .nav-links li span { display: block; font-size: 13px; white-space: normal; line-height: 1.2; }
    
    .main-content { margin-left: 0; padding: 15px; }
    .form-row { flex-direction: column; gap: 0; }
    
    .top-header { flex-direction: column; align-items: flex-start; gap: 20px; }
    .kpi-grid { grid-template-columns: 1fr; }
    
    .timer-layout { grid-template-columns: 1fr; }
    .radial-timer { width: 220px; height: 220px; }
    .timer-time { font-size: 42px; }
}
