/* ══════════════════════════════════════════════════════════════
   print.css — Stylesheet untuk semua dokumen cetak KEDAICORP
   Digunakan oleh print_base.html dan semua template extends-nya
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ───────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    margin: 2px;
    padding: 2px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-family: Cambria, "Times New Roman", Arial, sans-serif;
}

h1 { font-size: 30px; }
h2 { font-size: 25px; }
h3 { font-size: 21px; }
h4 { font-size: 14px; }
h5 { font-size: 13px; }

label { display: inline-block; }

/* ── Tables ─────────────────────────────────────────────────── */
table {
    border-collapse: collapse;
    width: 100%;
}

table.border        { border: 1px solid #000; }
table.border.thick  { border: 2px solid #000; }
table.data          { font-size: 12px; }
table.noborder *    { border: none !important; }
table.list          { border: 1px solid #000; }

table.border tr     { border-bottom: 1px solid #aaa; }

table.border td {
    padding: 2px 5px;
    border: 1px solid #aaa !important;
}

th {
    text-transform: uppercase;
    padding: 2px 5px;
    border: 1px solid #000 !important;
    background: #eee;
    text-align: left;
}

td, th { font-size: 9pt; }

tr.thick, thead tr.thick { border-bottom: 2px solid #000 !important; }

tr.footer {
    text-transform: uppercase;
    font-weight: bold;
    padding: 2px;
    border-top: 1px solid #000 !important;
    background: #eee;
}

th.thick, td.thick  { border: solid #000; border-width: 0 2px; }
td.top              { vertical-align: top; }
td.bilangan, th.bilangan, td.no_urut { text-align: center; }
th.padat, td.padat  { width: 1px; white-space: nowrap; text-align: center; }
td.border           { border: dotted 0.5px gray; }
th.border           { border: solid 0.5pt gray; }

/* ── Alignment ──────────────────────────────────────────────── */
.text-center        { text-align: center; }
.text-left          { text-align: left; }
.text-right         { text-align: right; }

/* ── Typography ─────────────────────────────────────────────── */
.judul              { text-transform: uppercase; text-align: center; }
.underline          { text-decoration: underline; }
.nowrap             { white-space: nowrap; }
.textx              { mso-number-format: "\@"; }

.pull-left          { position: relative; float: left; }
.pull-right         { position: relative; float: right; text-align: right; }

/* ── HR ─────────────────────────────────────────────────────── */
hr.garis {
    border-bottom: 2px solid #000;
    height: 0;
    margin-top: 5px;
    margin-bottom: 10px;
}

hr.dashed { border: 1px dashed #000; margin: 8px 0; }

/* ── Header dokumen ─────────────────────────────────────────── */
.print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 2px solid #000;
    margin-bottom: 8px;
}

.print-header .gerai-info p {
    font-size: 9pt;
    line-height: 1.4;
}

.print-header .gerai-nama {
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
}

.print-header .gerai-sub {
    font-size: 8pt;
    color: #444;
}

.print-header img.logo {
    max-height: 60px;
    max-width: 160px;
    object-fit: contain;
}

/* ── Footer dokumen ─────────────────────────────────────────── */
.print-footer {
    margin-top: 10px;
    border-top: 1px solid #000;
    padding-top: 5px;
    font-size: 8pt;
    color: #333;
}

.print-footer table td {
    text-align: center;
    border: none !important;
    font-size: 8pt;
    padding: 2px 4px;
}

/* ── Tanda tangan ───────────────────────────────────────────── */
table#ttd td {
    text-align: center;
    white-space: nowrap;
    border: none !important;
}

/* ── Badge status ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 8pt;
    font-weight: bold;
    border-radius: 3px;
    border: 1px solid #000;
}

.badge-success      { background: #d4edda; border-color: #28a745; }
.badge-warning      { background: #fff3cd; border-color: #ffc107; }
.badge-error        { background: #f8d7da; border-color: #dc3545; }
.badge-info         { background: #d1ecf1; border-color: #17a2b8; }
.badge-ghost        { background: #f0f0f0; border-color: #999; }
.badge-square       { border-radius: 0; }

/* ── HR + Logo branding ─────────────────────────────────────── */
.hr-logo {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 8px 0;
}

.hr-logo hr {
    flex-grow: 1;
    border: none;
    height: 1px;
    background: #000;
    margin: 0;
}

.hr-logo img {
    max-width: 200px;
    height: auto;
    margin-left: 10px;
}

/* ── Widget image ───────────────────────────────────────────── */
.widget-table-img {
    width: 114px;
    height: 60px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 3px;
    margin-right: 10px;
}

/* ── Tombol cetak (screen only) ─────────────────────────────── */
.btn-print-area {
    text-align: center;
    padding: 16px;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
}

.btn-print {
    padding: 8px 24px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.btn-print:hover { background: #162d4a; }

/* ── @media print ───────────────────────────────────────────── */
@media print {
    .no-print           { display: none !important; }
    .badge              { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
