/* Global Styles */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: #f4f7f6; color: #333; margin: 0; padding: 20px; box-sizing: border-box; }
h1, h2 { color: #2c3e50; margin-top: 0; }
a { text-decoration: none; color: #3498db; font-weight: bold; }
a:hover { text-decoration: underline; }

/* Layout Helpers */
.centered-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 0; margin: 0; }
.box, .login-box, .form-container { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); width: 100%; max-width: 400px; margin: 20px auto; }
.form-container.large { max-width: 600px; }

/* Forms */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; color: #333; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], textarea, select { 
    width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; margin-bottom: 10px; 
}
button, .btn { 
    padding: 10px 15px; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; display: inline-block; text-align: center; text-decoration: none;
}
button:hover, .btn:hover { opacity: 0.9; }

/* Button Colors */
button { background-color: #3498db; } /* Default Blue */
.btn-green { background-color: #27ae60; }
.btn-red { background-color: #e74c3c; }
.btn-orange { background-color: #f39c12; }
.btn-purple { background-color: #8e44ad; }
.btn-gray { background-color: #7f8c8d; }
.btn-back { display: block; text-align: center; margin-top: 15px; color: #7f8c8d; text-decoration: none; font-weight: normal; }

/* Messages */
.error { color: #721c24; background: #f8d7da; padding: 10px; border-radius: 4px; margin-bottom: 15px; }
.success { color: #155724; background: #d4edda; padding: 10px; border-radius: 4px; margin-bottom: 15px; }
.alert-text { color: #d35400; font-weight: bold; font-size: 0.8em; display: block; margin-top: 5px; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 1em; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
th { background-color: #3498db; color: white; }
tr:nth-child(even) { background-color: #f2f2f2; }
tr:hover { background-color: #e8f4f8; }
.warning-row { background-color: #fff3cd !important; }
.aksi a { margin-right: 10px; }

/* Header (Index) */
.header-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.header-menu { margin-top: 10px; }
.header-menu a { margin-right: 5px; }

/* Invoice Specific */
.invoice-body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding: 20px; }
.invoice-container { max-width: 800px; margin: 0 auto; background: white; padding: 40px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.invoice-header { display: flex; justify-content: space-between; margin-bottom: 40px; border-bottom: 2px solid #eee; padding-bottom: 20px; }
.invoice-controls { background: #2c3e50; color: white; padding: 15px; margin-bottom: 20px; border-radius: 5px; display: flex; gap: 15px; flex-wrap: wrap; align-items: flex-end; }
.invoice-controls label { color: #bdc3c7; font-size: 12px; margin-bottom: 5px; }
.invoice-controls input { width: 150px; margin-bottom: 0; }
.client-info { margin-bottom: 40px; display: flex; justify-content: space-between; }
.to { font-size: 14px; color: #7f8c8d; margin-bottom: 5px; }
.name { font-size: 18px; font-weight: bold; }
.text-right { text-align: right; }
.total-row td { font-weight: bold; font-size: 1.1em; border-top: 2px solid #333; }
.footer { margin-top: 50px; text-align: center; font-size: 12px; color: #999; }

/* Report Specific */
#report-content { width: 100%; max-width: 1000px; background: white; padding: 20px; margin: 0 auto; }
.no-print { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; background: #f9f9f9; padding: 15px; border-radius: 5px; }
body.capturing .aksi-col { display: none !important; }

/* Responsive & Print */
@media print {
    .no-print, .invoice-controls { display: none !important; }
    .invoice-container, #report-content { box-shadow: none; margin: 0; width: 100%; max-width: 100%; padding: 0; }
    @page { margin: 2cm; }
}

@media (max-width: 768px) {
    /* General Mobile */
    .header-wrap { flex-direction: column; align-items: flex-start; }
    .header-menu { width: 100%; }
    .header-menu a { display: block; margin: 5px 0; width: 100%; text-align: center; margin-right: 0 !important; }
    .header-menu span { display: block; margin-bottom: 5px; }
    
    /* Invoice Mobile */
    .invoice-controls { flex-direction: column; align-items: stretch; position: sticky; left: 10px; }
    .invoice-controls input, .invoice-controls button, .invoice-controls .btn-back { width: 100% !important; margin: 5px 0 !important; }
    .invoice-container { padding: 20px; min-width: 0; width: 100%; }
    
    /* Report Mobile */
    .no-print { flex-direction: column; gap: 10px; align-items: stretch; }
    #report-content { padding: 10px !important; }
}