
/* ===== Toast Notification ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; pointer-events: none; }
.toast { background: #2E7D32; color: white; padding: 14px 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: inline-flex; align-items: center; gap: 12px; animation: slideInToast 0.3s ease-out, slideOutToast 0.3s ease-out 2.7s forwards; font-weight: 500; margin-bottom: 8px; }
.toast::before { content: '✓'; font-weight: bold; font-size: 18px; flex-shrink: 0; }
@keyframes slideInToast { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutToast { from { transform: translateX(0); opacity: 1; } to { transform: translateX(400px); opacity: 0; } }
/* Hen-Tal SIM Manager - Mobile First */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", Arial, sans-serif;
    background: #F5F5F5;
    color: #212121;
    direction: rtl;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* Top bar */
.topbar {
    background: #2E7D32;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }
.topbar a { color: #fff; text-decoration: none; font-size: 14px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; }
.topbar-actions { display: flex; align-items: center; position: relative; }
.topbar-menu { display: flex; align-items: center; }
.topbar-burger {
    display: none;
    border: 1px solid rgba(255,255,255,.5);
    background: transparent;
    color: #fff;
    border-radius: 8px;
    min-width: 40px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* Container */
.container { max-width: 720px; margin: 0 auto; padding: 12px; }

/* Small screens - full width */
@media (max-width: 599px) {
    .container { max-width: 100%; padding: 8px; }

    .topbar {
        justify-content: flex-start;
        gap: 8px;
    }
    .topbar-actions {
        order: 0;
        margin-left: auto;
        margin-right: -10px;
    }
    .topbar h1 {
        font-size: 17px;
        white-space: nowrap;
        margin: 0;
        margin-right: 8px;
    }
    .topbar-burger { display: inline-flex; align-items: center; justify-content: center; }
    .topbar-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        min-width: 180px;
        background: #2E7D32;
        border: 1px solid rgba(255,255,255,.35);
        border-radius: 10px;
        box-shadow: 0 8px 18px rgba(0,0,0,.2);
        padding: 8px;
        flex-direction: column;
        gap: 6px;
        z-index: 500;
    }
    .topbar-menu.open { display: flex; }
    .topbar-menu .who { font-size: 12px; margin: 0 4px 4px; opacity: .9; }
    .topbar-menu a { width: 100%; text-align: center; }
}

/* Step cards */
.step {
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.step-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    background: #FAFAFA;
    border-bottom: 1px solid #EEE;
}
.step-num {
    background: #2E7D32; color: #fff;
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.step-num.done { background: #1B5E20; }
.step-title { flex: 1; font-weight: 600; font-size: 16px; }
.step-status { font-size: 13px; color: #757575; }
.step-status.ok { color: #2E7D32; font-weight: 600; }
.step-body { padding: 16px; display: none; }
.step.open .step-body { display: block; }
.step.open .step-head { background: #E8F5E9; }

/* Form fields */
label { display: block; font-size: 14px; font-weight: 600; margin: 10px 0 6px; color: #424242; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=email], input[type=password], textarea, select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #CFD8DC;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: #2E7D32; box-shadow: 0 0 0 3px rgba(46,125,50,.15);
}
textarea { resize: vertical; min-height: 120px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 20px;
    font-size: 16px; font-weight: 600;
    border: none; border-radius: 8px;
    cursor: pointer; text-decoration: none;
    min-height: 48px;
    font-family: inherit;
    transition: background .15s ease;
}
.btn-primary { background: #2E7D32; color: #fff; }
.btn-primary:hover { background: #1B5E20; }
.btn-secondary { background: #fff; color: #2E7D32; border: 1.5px solid #2E7D32; }
.btn-secondary:hover { background: #E8F5E9; }
.btn-danger { background: #C62828; color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 17px; min-height: 56px; }

/* Camera capture */
.camera-zone {
    border: 2px dashed #A5D6A7;
    border-radius: 10px;
    background: #F1F8E9;
    padding: 20px;
    text-align: center;
}
.camera-zone img.preview {
    max-width: 100%; max-height: 240px;
    border-radius: 8px;
    display: block;
    margin: 12px auto 0;
}
.camera-zone input[type=file] { display: none; }

.upload-actions-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.upload-actions-inline .btn {
    width: 100%;
    margin: 0;
}

/* Signature */
.sig-wrap {
    border: 2px solid #2E7D32;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    position: relative;
}
.sig-wrap canvas {
    width: 100%;
    height: 200px;
    display: block;
    touch-action: none;
    background: #fff;
    border-radius: 6px;
}
.sig-actions { display: flex; gap: 8px; margin-top: 10px; }
.sig-actions .btn { flex: 1; }

/* Messages */
.msg { padding: 12px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 500; }
.msg-ok { background: #E8F5E9; color: #1B5E20; border: 1px solid #A5D6A7; }
.msg-err { background: #FFEBEE; color: #B71C1C; border: 1px solid #EF9A9A; }
.msg-info { background: #E3F2FD; color: #0D47A1; border: 1px solid #90CAF9; }

/* Customer cards (mobile) */
.cust-card {
    background: #fff; border: 1px solid #E0E0E0; border-radius: 10px;
    padding: 14px; margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.cust-card .name { font-weight: 700; font-size: 17px; color: #1B5E20; margin: 0 0 4px; }
.cust-card .row { display: flex; justify-content: space-between; font-size: 14px; color: #555; margin: 3px 0; }
.cust-card .row span:last-child { color: #212121; font-weight: 500; }
.cust-card .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: nowrap; align-items: center; overflow-x: auto; }
.cust-card .actions .btn { flex: 0 0 auto; padding: 10px; font-size: 14px; min-height: 40px; }
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.ico-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}
.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-inline-end: 6px;
    border-radius: 8px;
    border: 1px solid #2E7D32;
    color: #2E7D32;
    text-decoration: none;
    vertical-align: middle;
    background: #fff;
    flex: 0 0 auto;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.action-link:hover { background: #E8F5E9; }
.action-link.danger { border-color: #C62828; color: #C62828; }
.action-link.danger:hover { background: #FFEBEE; }
.actions-cell { white-space: nowrap; }
.actions-inline { display: inline-flex; align-items: center; flex-wrap: nowrap; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-active { background: #E8F5E9; color: #1B5E20; }
.badge-blocked { background: #FFEBEE; color: #B71C1C; }
.badge-canceled { background: #ECEFF1; color: #455A64; }

/* Search bar */
.searchbar { background: #fff; padding: 12px; border-radius: 10px; border: 1px solid #E0E0E0; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.searchbar input { flex: 1; }
.searchbar .btn { padding: 12px 18px; }
.searchbar select,
.status-filter { padding: 8px 10px; border: 1px solid #DDD; border-radius: 6px; background: #fff; font-family: inherit; font-size: 14px; color: #333; cursor: pointer; }
.searchbar select:hover,
.status-filter:hover { border-color: #2E7D32; }

/* Small screen adjustments (< 600px width) */
@media (max-width: 599px) {
    .cust-card { padding: 12px; }
    .cust-card .actions { gap: 3px; }
    .cust-card .actions .btn { padding: 6px; width: 32px; height: 32px; min-height: 32px; }
    .btn-icon { width: 32px; height: 32px; padding: 6px; }
    .ico-svg { width: 16px; height: 16px; }
    .searchbar select,
    .status-filter {
        width: 86px;
        min-width: 86px;
        max-width: 86px;
        padding: 8px 6px;
        font-size: 13px;
    }
}

/* Desktop table */
.cust-table { display: none; }
@media (min-width: 900px) {
    .cust-cards { display: none; }
    .cust-table { display: table; width: 100%; background: #fff; border-collapse: collapse; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
    .cust-table th, .cust-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid #EEE; font-size: 14px; }
    .cust-table th { background: #2E7D32; color: #fff; font-weight: 600; }
    .cust-table tr:hover td { background: #F1F8E9; }
}

/* Loader */
.loader { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.muted { color: #757575; font-size: 13px; }
.muted-light { color: rgba(255,255,255,.85); font-size: 13px; margin-left: 8px; }
.hide { display: none !important; }
.center { text-align: center; }
.small { font-size: 12px; }
.section-h { font-size: 18px; color: #1B5E20; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #E8F5E9; }

/* ===== Login page ===== */
.login-body { background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%); min-height: 100vh; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; padding: 16px 24px 22px; border-radius: 14px; max-width: 380px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.login-brand { text-align: center; margin-bottom: 8px; overflow: hidden; }
.login-brand h1 { color: #2E7D32; margin: 4px 0 4px; font-size: 22px; }
.login-logo { width: 100%; max-width: 360px; height: 170px; object-fit: cover; object-position: center; margin: 0 auto; display: block; }

/* ===== Admin tabs ===== */
.tabs { display: flex; gap: 4px; margin: 4px 0 16px; border-bottom: 2px solid #E0E0E0; }
.tab { background: transparent; border: none; padding: 12px 16px; font-size: 15px; font-weight: 600; color: #757575; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: inherit; }
.tab.active { color: #2E7D32; border-bottom-color: #2E7D32; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.logo-preview { max-height: 80px; max-width: 220px; border: 1px solid #E0E0E0; border-radius: 6px; padding: 6px; background: #fff; margin-bottom: 8px; }

/* ===== Users ===== */
.btn-collapse {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: #2E7D32;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    margin-bottom: 10px;
    transition: background .12s ease, box-shadow .12s ease;
    font-family: inherit;
}
.btn-collapse:hover { background: #1B5E20; box-shadow: 0 2px 4px rgba(0,0,0,.12); }
.btn-collapse.active { background: #1B5E20; }
.collapse-icon {
    display: inline-block;
    font-size: 12px;
    transition: transform .2s ease;
}
.user-form-card { background: #F1F8E9; border: 1px solid #C8E6C9; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.edit-panel-row { background: #F1F8E9; }
.edit-panel-row td { padding: 14px; border-bottom: 2px solid #C8E6C9; }
.edit-panel-card { background: #fff; border: 1px solid #E0E0E0; border-radius: 10px; padding: 14px; }
.edit-panel-card input,
.edit-panel-card select { width: 100%; padding: 8px; border: 1px solid #DDD; border-radius: 6px; font-family: inherit; font-size: 14px; box-sizing: border-box; }
.edit-panel-card input:focus,
.edit-panel-card select:focus { outline: none; border-color: #2E7D32; box-shadow: 0 0 0 2px rgba(46, 125, 50, .1); }
.edit-panel-card label { display: block; margin: 8px 0 4px; font-weight: 500; color: #333; font-size: 14px; }
.edit-panel-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }
.edit-panel-actions .btn { padding: 10px 20px; min-height: auto; }
.users-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #E0E0E0; border-radius: 10px; }
.users-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.users-table th,
.users-table td { padding: 10px; border-bottom: 1px solid #EEE; text-align: right; vertical-align: middle; font-size: 14px; }
.users-table th { background: #2E7D32; color: #fff; font-weight: 600; white-space: nowrap; }
.users-table tr:not(.edit-panel-row):hover td { background: #F1F8E9; }
.users-table .role-select,
.users-table input[type="password"],
.users-table select { min-width: 130px; }
.users-actions { white-space: nowrap; }
.users-actions .action-btn { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-inline-end: 6px;
    border-radius: 8px;
    border: 1px solid #2E7D32;
    color: #2E7D32;
    background: #fff;
    padding: 0;
    cursor: pointer;
    font-size: 0;
    flex: 0 0 auto;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
    text-decoration: none;
}
.users-actions .action-btn:hover { background: #E8F5E9; }
.users-actions .action-btn.danger { border-color: #C62828; color: #C62828; }
.users-actions .action-btn.danger:hover { background: #FFEBEE; }
.users-actions .action-btn.toggle-status.danger { border-color: #C62828; color: #C62828; }
.users-actions .action-btn.toggle-status.danger:hover { background: #FFEBEE; border-color: #C62828; }
.actions-inline { display: inline-flex; align-items: center; flex-wrap: nowrap; }

.field-check-msg {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    min-height: 18px;
}

.field-check-msg.ok { color: #2E7D32; }
.field-check-msg.err { color: #C62828; }

.input-dup-ok { border-color: #2E7D32 !important; }
.input-dup-err { border-color: #C62828 !important; background: #FFF5F5; }

.lease-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 6px 0 8px;
}

.lease-params-title {
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.lease-param-btn {
    border: 1px dashed #2E7D32;
    background: #F1F8E9;
    color: #1B5E20;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.lease-param-btn:hover {
    background: #E8F5E9;
}

.simple-rte-wrap {
    border: 1px solid #D6D6D6;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.simple-rte-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    border-bottom: 1px solid #ECECEC;
    background: #FAFAFA;
}

.simple-rte-toolbar button {
    min-width: 34px;
    height: 30px;
    border: 1px solid #D0D0D0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 13px;
}

.simple-rte-toolbar button:hover {
    background: #E8F5E9;
    border-color: #2E7D32;
}

.simple-rte-editor {
    min-height: 260px;
    padding: 10px;
    outline: none;
    line-height: 1.6;
}

.simple-rte-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(46,125,50,.2);
}

/* ===== Permissions matrix ===== */
.perms-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #E0E0E0; border-radius: 10px; }
.perms-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perms-table th { background: #2E7D32; color: #fff; padding: 10px; font-weight: 600; text-align: center; }
.perms-table th:first-child { text-align: right; min-width: 200px; }
.perms-table td { padding: 10px; border-bottom: 1px solid #EEE; text-align: center; }
.perms-table tr:hover td { background: #F1F8E9; }
.perm-name { text-align: right; font-weight: 600; }
.perm-code { font-size: 11px; color: #999; font-family: monospace; font-weight: 400; }
.perm-cell input[type=checkbox] { width: 22px; height: 22px; cursor: pointer; accent-color: #2E7D32; }

/* ===== Idle warning modal ===== */
.idle-warn { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.idle-warn-box { background: #fff; border-radius: 12px; padding: 24px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.idle-warn-title { color: #C62828; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.idle-warn-text { color: #424242; margin-bottom: 18px; }
.idle-warn-text #idleSec { font-weight: 700; color: #C62828; }

/* Topbar links spacing tweak */
.topbar > div { display: flex; align-items: center; }
