/* ============================================
   HOTEL CONTRACT SYSTEM - SaaS Style
   Alya Trip © 2026
   ============================================ */

/* ---- RESET & BASE ---- */
.hcs-contract-wrapper *,
.hcs-contract-wrapper *::before,
.hcs-contract-wrapper *::after {
    box-sizing: border-box;
}
.hcs-contract-wrapper {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #2d3748;
    max-width: 900px;
    margin: 30px auto;
    line-height: 1.7;
}

/* ---- HEADER ---- */
.hcs-contract-header {
    background: linear-gradient(135deg, #1a3c6e 0%, #2c7be5 100%);
    color: #fff;
    padding: 30px 35px;
    border-radius: 12px 12px 0 0;
}
.hcs-contract-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.hcs-contract-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fff;
}
.hcs-contract-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 14px;
    font-size: 13px;
    opacity: 0.92;
}
.hcs-contract-meta span {
    background: rgba(255,255,255,0.12);
    padding: 5px 12px;
    border-radius: 20px;
}

/* ---- BADGES ---- */
.hcs-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}
.hcs-badge-draft    { background: #6c757d; }
.hcs-badge-pending  { background: #fd7e14; }
.hcs-badge-approved { background: #28a745; }
.hcs-badge-signed   { background: #007bff; }
.hcs-badge-rejected { background: #dc3545; }
.hcs-badge-revision { background: #6610f2; }

/* ---- BODY ---- */
.hcs-contract-body {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 35px 40px;
}
.hcs-contract-content {
    font-size: 14.5px;
    line-height: 1.9;
    color: #333;
}
.hcs-contract-content h2,
.hcs-contract-content h3 { color: #1a3c6e; margin-top: 24px; }
.hcs-contract-content p  { margin-bottom: 14px; }
.hcs-contract-content ul,
.hcs-contract-content ol { padding-left: 24px; margin-bottom: 14px; }

/* ---- SECTION TITLES ---- */
.hcs-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a3c6e;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ---- SIGNATURE SECTION ---- */
.hcs-signature-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 30px 40px;
}
.hcs-sign-notice {
    background: #fff8e1;
    border-left: 4px solid #fd7e14;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 20px;
}

/* Canvas */
.hcs-canvas-wrapper { margin-bottom: 15px; }
.hcs-canvas-label   { font-size: 13px; color: #555; margin-bottom: 8px; font-weight: 600; }
.hcs-canvas {
    width: 100%;
    height: 200px;
    border: 2px dashed #2c7be5;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
    display: block;
    touch-action: none;
}
.hcs-canvas:hover { border-color: #1a3c6e; box-shadow: 0 0 0 3px rgba(44,123,229,.15); }
.hcs-canvas-hint  { font-size: 11px; color: #aaa; margin-top: 6px; }

/* Actions */
.hcs-sign-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

/* Buttons */
.hcs-btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.hcs-btn:hover      { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.hcs-btn:disabled   { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.hcs-btn-sign       { background: #1a3c6e; color: #fff; }
.hcs-btn-clear      { background: #e9ecef; color: #555; }
.hcs-btn-pdf        { background: #28a745; color: #fff; }
.hcs-btn-approve    { background: #28a745; color: #fff; }
.hcs-btn-reject     { background: #dc3545; color: #fff; }
.hcs-btn-send       { background: #fd7e14; color: #fff; }

/* Message */
.hcs-sign-message {
    min-height: 24px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    transition: all 0.3s;
}

/* Checkbox */
.hcs-confirm-check {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: #444;
    margin-top: 12px;
}
.hcs-confirm-check label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hcs-confirm-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #1a3c6e; }

/* Signed box */
.hcs-signed-box {
    background: #f0fff4;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 25px 30px;
    text-align: center;
}
.hcs-signed-stamp {
    display: inline-block;
    background: #28a745;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 20px;
    border-radius: 20px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}
.hcs-signature-img {
    max-width: 300px;
    max-height: 120px;
    border: 1px solid #c3e6cb;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    display: block;
    margin: 0 auto 12px;
}
.hcs-signed-info { font-size: 12px; color: #666; }

/* Not signable */
.hcs-not-signable {
    background: #fff8e1;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px 25px;
    font-size: 14px;
    color: #856404;
    text-align: center;
}

/* ---- EDIT REQUEST ---- */
.hcs-edit-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 25px 40px;
}
.hcs-edit-request-form h3 { color: #fd7e14; font-size: 16px; margin-bottom: 8px; }
.hcs-edit-request-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: border 0.2s;
}
.hcs-edit-request-form textarea:focus {
    outline: none;
    border-color: #2c7be5;
    box-shadow: 0 0 0 3px rgba(44,123,229,.1);
}

/* ---- VERSIONS ---- */
.hcs-versions-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 25px 40px;
}
.hcs-versions-list  { display: flex; flex-direction: column; gap: 8px; }
.hcs-version-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: #f8fafc;
    border-radius: 7px;
    border-left: 3px solid #2c7be5;
    font-size: 13px;
}
.hcs-version-badge {
    background: #2c7be5;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.hcs-version-date    { color: #888; white-space: nowrap; }
.hcs-version-changes { color: #444; }

/* ---- ADMIN PAGES ---- */
.hcs-admin-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 25px 30px;
    margin-bottom: 24px;
}
.hcs-admin-card h2 {
    font-size: 18px;
    color: #1a3c6e;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.hcs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.hcs-stat-box {
    background: linear-gradient(135deg, #1a3c6e, #2c7be5);
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}
.hcs-stat-box .hcs-stat-number { font-size: 28px; font-weight: 700; display: block; }
.hcs-stat-box .hcs-stat-label  { font-size: 12px; opacity: 0.85; margin-top: 4px; display: block; }
.hcs-stat-box.orange  { background: linear-gradient(135deg, #c25c00, #fd7e14); }
.hcs-stat-box.green   { background: linear-gradient(135deg, #155724, #28a745); }
.hcs-stat-box.red     { background: linear-gradient(135deg, #721c24, #dc3545); }
.hcs-stat-box.purple  { background: linear-gradient(135deg, #4a0080, #6610f2); }

/* Table admin */
.hcs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hcs-table th {
    background: #f1f4f9;
    color: #1a3c6e;
    font-weight: 700;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}
.hcs-table td { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.hcs-table tr:hover td { background: #f8fafc; }
.hcs-table .hcs-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Error */
.hcs-error {
    background: #fff5f5;
    border: 1px solid #fc8181;
    color: #c53030;
    padding: 12px 18px;
    border-radius: 7px;
    font-size: 14px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .hcs-contract-header      { padding: 20px; }
    .hcs-contract-title       { font-size: 17px; }
    .hcs-contract-title-row   { flex-direction: column; align-items: flex-start; }
    .hcs-contract-body,
    .hcs-signature-section,
    .hcs-edit-section,
    .hcs-versions-section     { padding: 20px; }
    .hcs-sign-actions         { flex-direction: column; }
    .hcs-btn                  { width: 100%; text-align: center; padding: 13px; }
    .hcs-stats-grid           { grid-template-columns: repeat(2, 1fr); }
    .hcs-version-item         { flex-direction: column; align-items: flex-start; gap: 5px; }
    .hcs-table                { font-size: 12px; }
    .hcs-table th,
    .hcs-table td             { padding: 9px 10px; }
    .hcs-contract-meta        { gap: 8px; }
    .hcs-contract-meta span   { font-size: 11px; padding: 4px 9px; }
    .hcs-canvas               { height: 160px; }
}

@media (max-width: 480px) {
    .hcs-contract-wrapper { margin: 10px; }
    .hcs-stats-grid       { grid-template-columns: 1fr 1fr; }
    .hcs-stat-box         { padding: 14px 10px; }
    .hcs-stat-box .hcs-stat-number { font-size: 22px; }
}