@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* --- Additions for v0.5 Part 2 (Help Page Styles) --- */

/* Admin Statistics and Backup Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h4 {
    margin: 0 0 10px 0;
    font-size: 1em;
    opacity: 0.9;
}

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: bold;
    margin: 0;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.backup-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.backup-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.backup-section h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.backup-section button {
    margin: 5px;
    margin-left: 0;
}

#backupStatus, #maintenanceStatus {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.backup-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.backup-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Additional admin button styles */
.reset-password-btn { background: #ffc107; color: #212529; }
.toggle-status-btn { background: #17a2b8; color: white; }
.export-data-btn { background: #6c757d; color: white; }
.send-notification-btn { background: #28a745; color: white; }

@media (max-width: 768px) {
    .backup-options {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}



.help-content {

    text-align: right; /* Ensure main content aligns right */

}



.help-section {

    margin-bottom: 30px;

    padding-bottom: 20px;

    border-bottom: 1px solid #eee;

}



.help-section:last-child {

     border-bottom: none; /* No border for the last section */

}



.help-section h4 {

    color: var(--primary-color);

    margin-bottom: 15px;

    border-bottom: none; /* Remove double border */

    padding-bottom: 0;

    font-size: 1.2em;

}



.help-section p, .help-section ul {

    text-align: right;

    margin-bottom: 10px;

    line-height: 1.8;

    color: var(--text-dark);

}



.help-section ul {

    padding-right: 20px; /* Indent list */

}



.help-section li {

    margin-bottom: 8px;

}



.help-section code {

    background-color: #e9ecef;

    padding: 2px 5px;

    border-radius: 4px;

    font-family: monospace;

    direction: ltr;

    display: inline-block;

    border: 1px solid #ddd; /* Add subtle border */

}



/* Accurate mm-based preview for System 1 */

.mm-preview-container {

    position: relative;

    background: #f5f5f5;

    border: 1px solid #ddd;

    overflow: auto;

    padding: 8px;

    display: flex;

    justify-content: center;

    align-items: center;

    min-height: 120px;

}



.mm-preview-card {

    position: relative;

    transform-origin: top left;

    border: 1px solid #ccc;

    box-shadow: 0 2px 8px rgba(0,0,0,0.1);

}



.preview-zoom-controls {

    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 6px;

    margin-bottom: 6px;

}



.preview-zoom-controls label {

    margin: 0;

    white-space: nowrap;

    font-weight: 600;

}



.preview-zoom-controls input[type="range"] {

    flex: 1;

    margin: 0;

}



.preview-zoom-controls span {

    min-width: 48px;

    text-align: right;

    font-weight: 700;

    color: #0d47a1;

}



.mm-preview-background {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    object-fit: fill;

    pointer-events: none;

}



.mm-preview-element {

    position: absolute;

    font-family: Helvetica, Arial, sans-serif;

    white-space: nowrap;

    transform-origin: center;

    display: inline-block;

    line-height: 1.2;

    margin: 0;

    padding: 0;

}



.preview-resize-handle {

    position: absolute;

    width: 10px;

    height: 10px;

    right: -8px;

    bottom: -8px;

    border-radius: 50%;

    background: #0d47a1;

    border: 1px solid #ffffff;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);

    cursor: ns-resize;

    z-index: 3;

}



.mm-preview-qr {

    border: 1px solid #ddd;

    background: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 8px;

    color: #666;

}





/* --- Existing Styles Below (Copied from css_style_v05p2_ajax / style2.txt) --- */

/* Spinner Style */

.spinner { display: none; box-sizing: border-box; border: 2px solid rgba(255,255,255,.3); border-radius: 50%; border-top-color: var(--white); width: 1em; height: 1em; animation: spin 0.8s linear infinite; margin-left: 6px; vertical-align: middle; }

@keyframes spin { to { transform: rotate(360deg); } }

.action-in-progress { opacity: 0.7; cursor: wait; }

.action-in-progress .spinner { display: inline-block; }

/* Status Badges */

.status-badge { display: inline-block; padding: 0.25em 0.6em; font-size: 0.8em; font-weight: 600; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.375rem; color: #fff; }

.status-approved { background-color: var(--success-color); }

.status-pending { background-color: var(--warning-color); color: #fff; }

.status-limited { background-color: var(--info-color); } /* Added for limited status */

/* --- Base Styles --- */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700;800&display=swap');

:root { --primary-color: #0056b3; --secondary-color: #003d80; --accent-color: #28a745; --elias-net-color: var(--secondary-color); --warning-color: #fd7e14; --info-color: #17a2b8; --light-gray: #f8f9fa; --medium-gray: #e9ecef; --dark-gray: #6c757d; --border-color: #ced4da; --shadow-light: rgba(0, 0, 0, 0.05); --shadow-medium: rgba(0, 0, 0, 0.1); --text-dark: #212529; --text-light: #495057; --white: #fff; --danger-color: #dc3545; --success-color: #28a745; --link-color: #0056b3; }

body { font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; text-align: center; direction: rtl; background-color: var(--medium-gray); margin: 0; padding: 0; line-height: 1.7; color: var(--text-dark); font-size: 16px; }

.container { width: 95%; max-width: 1600px; margin: 12px auto; padding: 18px 22px; background-color: var(--white); border-radius: 16px; box-shadow: 0 6px 20px var(--shadow-medium); border: 1px solid var(--border-color); }

header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); text-align: center; }

h1 { color: var(--primary-color); margin-top: 0; margin-bottom: 0; font-weight: 700; font-size: 2.4em; }

h1 .brand { color: var(--white); background-color: var(--elias-net-color); font-weight: 700; font-size: 0.8em; margin-left: 15px; display: inline-block; vertical-align: middle; padding: 5px 12px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }



/* --- Header Controls --- */

.header-controls {

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    align-items: center;

    justify-content: center;

    margin-top: 15px;

    padding: 0 15px;

}

.header-controls .user-info {

    color: var(--text-light);

    font-size: 0.9em;

    white-space: nowrap;

    flex-basis: 100%;

    text-align: center;

    margin-bottom: 5px;

}

.header-controls .button {

    padding: 6px 12px;

    font-size: 0.85em;

    margin: 3px;

    white-space: nowrap;

}

.header-controls .admin-link { background-color: var(--accent-color); }

.header-controls .history-link { background-color: var(--info-color); }

.header-controls .logout-btn { background-color: var(--danger-color); }

.header-controls .logout-btn:hover { background-color: #c82333; }



/* --- Modern Header Navigation --- */
.modern-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: relative;
    z-index: 1000;
    margin-bottom: 10px;
    padding: 6px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-brand-group h1 {
    font-size: 1.5em;
    margin: 0;
}

.nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.1em;
}

.nav-user-group {
    display: flex;
    align-items: center;
    gap: 15px;
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
    margin-right: 10px;
}

.user-badge {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-badge .name {
    font-weight: 700;
    font-size: 0.9em;
    color: var(--text-dark);
}

.user-badge .role {
    font-size: 0.75em;
    color: var(--text-light);
}

.nav-btn-logout {
    background-color: #fff1f0;
    color: #ff4d4f;
}

.nav-btn-logout:hover {
    background-color: #ff4d4f;
    color: white;
}

/* Responsive Nav */
@media (max-width: 1024px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-user-group {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        width: 100%;
        justify-content: center;
    }
}

/* --- End Modern Header --- */

h3 { color: var(--secondary-color); margin-top: 0; margin-bottom: 10px; font-weight: 600; font-size: 1.4em; text-align: right; }

h4 { margin-top: 0; margin-bottom: 10px; color: var(--primary-color); border-bottom: 2px solid var(--accent-color); padding-bottom: 8px; font-weight: 600; font-size: 1.2em; text-align: right;}

hr { border: none; border-top: 1px solid #e0e0e0; margin: 10px 0; }

.main-section { margin-bottom: 14px; padding: 16px; background-color: var(--light-gray); border-radius: 10px; border: 1px solid var(--border-color); box-shadow: 0 2px 6px var(--shadow-light); }

.main-section h3 { border-bottom: 1px solid #eee; padding-bottom: 8px;}

label { display: block; margin-bottom: 4px; font-size: 0.93em; color: var(--text-light); font-weight: 500; text-align: right; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="file"], input[type="range"], input[type="color"], input[type="date"], select, textarea { display: block; width: 100%; max-width: 500px; margin-bottom: 8px; padding: 7px 12px; font-size: 0.93em; font-family: inherit; line-height: 1.4; color: var(--text-dark); background-color: var(--white); background-clip: padding-box; border: 1px solid var(--border-color); border-radius: 6px; box-shadow: var(--shadow-light); transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; box-sizing: border-box; margin-left: auto; margin-right: auto; min-height: calc(1.4em + 14px + 2px); appearance: none; -webkit-appearance: none; -moz-appearance: none; }

input:focus, select:focus, textarea:focus { border-color: var(--primary-color); outline: 0; box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25); }

input[type="file"] { cursor: pointer; border-style: dashed; background-color: #f0f7ff; color: var(--primary-color); min-height: initial; line-height: initial; padding: 10px 15px; }

input[type="color"] { padding: 2px; height: 45px; max-width: 80px; cursor: pointer; border: 1px solid var(--border-color); border-radius: 6px; min-height: initial; line-height: initial; box-shadow: none;}

input[type="range"] { min-height: initial; padding: 0; height: 6px; border: none; box-shadow: none; background: none; cursor: pointer; accent-color: var(--primary-color); }

input[type="checkbox"] { width: 1.1em; height: 1.1em; display: inline-block; margin-left: 8px; accent-color: var(--primary-color); cursor: pointer; min-height: initial; border: initial; border-radius: initial; box-shadow: none; background-color: initial; appearance: checkbox; }

input[type="date"] { max-width: 200px; appearance: auto; -webkit-appearance: auto; -moz-appearance: auto; }

label.inline-label { display: inline-block !important; font-weight: normal; color: var(--text-dark); margin-bottom: 0; cursor: pointer;}

select { background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230056b3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: left 1rem center; background-size: .65em auto; padding-left: 2.5rem; }

textarea { min-height: 100px; resize: vertical; }

.main-section form { max-width: 500px; margin: 20px auto; }

.main-section form input[type="number"], .main-section form input[type="text"], .main-section form input[type="password"], .main-section form input[type="email"], .main-section form select, .main-section form textarea { max-width: 100%; margin-left: 0; margin-right: 0; }

.main-section form input[type="color"] { max-width: 80px; display: inline-block; margin-left: 0; margin-right: 0; }

.button-group { text-align: center; }

.button-group button, .button-group .button { margin: 10px 5px; }

button, .button { background-color: var(--primary-color); color: white; border: none; padding: 12px 25px; font-size: 1em; cursor: pointer; border-radius: 8px; transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.3s ease; font-weight: 600; box-shadow: 0 3px 6px rgba(0,0,0,0.1); text-decoration: none; display: inline-block; vertical-align: middle; }

button:hover, .button:hover { background-color: var(--secondary-color); transform: translateY(-2px); box-shadow: 0 5px 10px rgba(0,0,0,0.15); color: white;}

button:disabled { background-color: #bbb; cursor: not-allowed; transform: none; box-shadow: none; opacity: 0.7;}

.auto-calc-btn { background-color: var(--white); color: var(--primary-color); border: 1px solid var(--primary-color); padding: 5px 12px; font-size: 0.8em; margin-right: 10px; margin-bottom: 18px; border-radius: 6px; vertical-align: middle; font-weight: 500; box-shadow: none; }

.auto-calc-btn:hover { background-color: #e3f2fd; transform: none; box-shadow: none;}

.logout-btn { background-color: var(--danger-color); padding: 8px 15px; font-size: 0.9em; }

 .logout-btn:hover { background-color: #c82333; }

#generateMikrotikScriptBtn { background-color: var(--accent-color); }

#generateMikrotikScriptBtn:hover { background-color: #218838; }

.btn-secondary { background-color: var(--dark-gray); }

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

.delete-btn { background-color: var(--danger-color); }

.delete-btn:hover { background-color: #c82333; }

.alert { position: relative; padding: .75rem 1.25rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: .25rem; text-align: right; }

.alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }

.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }

.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }

.alert-info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; }

.alert-link { font-weight: bold; color: #5b4300; text-decoration: underline; }

#progress-area { text-align: center; padding: 12px; }

#progress-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-dark); font-size: 1.05em; }

#progress-bar { width: 90%; max-width: 600px; height: 20px; border-radius: 10px; overflow: hidden; accent-color: var(--success-color); border: 1px solid var(--border-color); background-color: #e9ecef; }

#progress-percentage { display: block; margin-top: 12px; font-weight: bold; color: var(--primary-color); font-size: 1.2em; }

#progress-details { font-size: 0.95em; color: var(--text-light); display: block; margin-top: 8px; }

.design-preview-section { margin-top: 14px; padding: 16px; background-color: #eef2f7; border-radius: 12px; border: 1px solid #BBDEFB; }

.step3-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(340px, 460px) minmax(220px, 280px); column-gap: 28px; row-gap: 12px; align-items: start; justify-content: center; }
.step3-side-col { width: 100%; min-width: 0; overflow: hidden; }
.step3-preview-col { width: 100%; max-width: 460px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 8px; justify-self: center; position: relative; z-index: 2; }
.step3-left-col .position-controls, .step3-right-col .position-controls { max-width: 100%; width: 100%; align-items: stretch; }

.preview-layout-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }

.interactive-preview-area { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; background-color: var(--white); box-shadow: 0 2px 8px var(--shadow-light); }

.card-like { padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; background-color: var(--white); box-shadow: 0 2px 8px var(--shadow-light); box-sizing: border-box; overflow: hidden; }

.interactive-preview-area h4 { color: var(--secondary-color); margin-bottom: 8px; font-weight: 600; text-align: center; width: 100%; border-bottom: 1px solid #eee; padding-bottom: 8px; font-size: 1.1em;}

#design-container { position: relative; width: 100%; max-width: 420px; aspect-ratio: 37 / 26; height: auto; margin: 0 auto; overflow: hidden; box-sizing: border-box; background: var(--medium-gray); border: 2px dashed var(--dark-gray); border-radius: 10px; }

#card-image { display: block; width: 100%; height: 100%; object-fit: fill; position: absolute; top: 0; left: 0; }

.draggable { position: absolute; cursor: default; background: rgba(255, 255, 255, 0.9); padding: 5px 8px; border-radius: 4px; color: var(--text-dark); box-shadow: 0 1px 4px var(--shadow-light); white-space: nowrap; transition: top 0.1s, left 0.1s, font-size 0.2s; z-index: 10; transform: translate(-50%, -50%) !important; }

.qr-preview-box { display: flex; align-items: center; justify-content: center; }

.position-controls { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 100%; min-width: 0; }

.control-group { background: #fdfdfd; padding: 10px; border-radius: 6px; box-shadow: 0 1px 3px var(--shadow-light); border: 1px solid #eee; margin-bottom: 6px; width: 100%; box-sizing: border-box; overflow: hidden; }

.control-group h5 { margin: 0 0 6px 0; color: var(--text-dark); font-weight: 600; font-size: 0.97em; }

.slider-container { display: flex; flex-direction: column; margin-bottom: 5px; width: 100%; min-width: 0; }

.slider-container label { margin-bottom: 5px; font-size: 0.85em; color: #666; text-align: right; line-height: 1.5; }

.slider-container input[type="range"] { width: 100%; margin: 5px 0; cursor: pointer; accent-color: var(--primary-color); height: 6px; }

.slider-value { font-size: 0.8em; color: var(--primary-color); font-weight: bold; }

.step3-side-col .checkbox-group { width: 100%; margin: 2px 0 4px; text-align: right; }


#scriptOutputArea { border: none; background-color: transparent; padding: 0; margin-top: 20px; box-shadow: none; width: 100%; max-width: 420px; box-sizing: border-box; text-align: right; }

#scriptOutputArea label { font-size: 1em; font-weight: 600; color: var(--text-dark); margin-bottom: 10px;}

#mikrotikScriptOutput { width: 100%; font-family: 'Courier New', Courier, monospace; direction: ltr; text-align: left; background-color: var(--medium-gray); border-radius: 8px; padding: 15px; min-height: 180px; margin-bottom: 15px; line-height: 1.4; font-size: 0.9em; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }

#copyMikrotikScriptBtn { background-color: var(--dark-gray); font-size: 0.95em; padding: 10px 20px; display: block; margin: 10px auto 0 auto; max-width: 200px; }

#copyMikrotikScriptBtn:hover { background-color: #5a6268; }

.settings { background-color: var(--white); padding: 12px; border-radius: 12px; margin-top: 14px; border: 1px solid var(--border-color); box-shadow: 0 2px 10px var(--shadow-light); }

.settings h3 { color: var(--secondary-color); margin-top: 0; margin-bottom: 10px; font-weight: 600; text-align: center; font-size: 1.35em; }

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-items: stretch; }

.section { display: flex; flex-direction: column; padding: 12px; background-color: var(--light-gray); border-radius: 8px; border: 1px solid #e5e5e5; box-shadow: 0 1px 5px var(--shadow-light); height: 100%; }

.section h4 { margin: 0 0 10px 0; font-size: 1.05em; font-weight: 600; color: var(--secondary-color); text-align: center; border-bottom: 2px solid rgba(40, 167, 69, 0.3); padding-bottom: 6px; }

.section label { font-size: 0.88em; margin-bottom: 3px; font-weight: 500; color: var(--text-light); display: block; }

.section .input-with-button { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }

.section .input-with-button input { margin-bottom: 0; flex-grow: 1; }

/* New styles for small calc buttons */
.field-with-calc { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }

.field-with-calc label { min-width: 100px; margin-bottom: 0; }

.field-with-calc .input-with-small-btn { display: flex; align-items: center; gap: 5px; flex: 1; }

.field-with-calc .input-with-small-btn input { margin-bottom: 0; flex: 1; }

.small-calc-btn { 
    background-color: var(--primary-color); 
    color: var(--white); 
    border: none; 
    width: 28px; 
    height: 28px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.small-calc-btn:hover { 
    background-color: var(--primary-dark); 
    transform: scale(1.05); 
}

.small-calc-btn:active { 
    transform: scale(0.95); 
}

.small-calc-btn:disabled {
    background-color: #ccc; 
    cursor: not-allowed; 
    transform: none; 
}

.section input { margin-bottom: 8px; }

.qr-login-controls-block { margin-top: 10px; padding: 10px; background: linear-gradient(180deg, rgba(13,71,161,0.08), rgba(13,71,161,0.04)); border-radius: 8px; border: 1px solid rgba(13,71,161,0.2); }

.qr-login-controls-block h5 { margin: 0 0 8px 0; color: var(--secondary-color); font-weight: 700; font-size: 0.98em; text-align: right; }

.qr-login-controls-block label { margin-bottom: 3px; }

.qr-login-controls-block input { margin-bottom: 8px; }

.nested-options { margin-right: 12px; margin-top: 4px; padding-right: 10px; border-right: 3px solid var(--border-color); }

.nested-options label { font-size: 0.95em; }

.checkbox-group { margin: 6px 0; text-align: right; }

.font-size-group label { display: block; margin-top: 6px; margin-bottom: 3px;}

.admin-table { width: 100%; border-collapse: collapse; margin-top: 25px; font-size: 0.95em; }

.admin-table th, .admin-table td { border: 1px solid var(--border-color); padding: 12px 15px; text-align: right; vertical-align: middle; }

.admin-table th { background-color: var(--primary-color); color: white; font-weight: 600; }

.admin-table tr:nth-child(even) { background-color: var(--light-gray); }

.admin-table tr:hover { background-color: #e9ecef; }

.admin-table button, .admin-table .button { font-size: 0.85em; padding: 5px 10px; margin: 2px; }

.admin-table .edit-btn { background-color: #ffc107; color: #333;}

.admin-table .edit-btn:hover { background-color: #e0a800; }

.admin-table .approve-btn { background-color: var(--success-color); }

.admin-table .approve-btn:hover { background-color: #218838; }

.admin-table .unapprove-btn { background-color: var(--warning-color); }

.admin-table .unapprove-btn:hover { background-color: #e66a0a; }

.admin-table .action-buttons { white-space: nowrap; }

.admin-search-form { background-color: #e9ecef; padding: 20px; border-radius: 8px; margin-bottom: 30px; border: 1px solid #dee2e6;}

.admin-search-form h4 { margin-bottom: 15px; font-size: 1.2em; color: var(--secondary-color); border: none; text-align: center; }

.history-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }

/* .search-form is now .search-box in history.php */

/* .search-fields is now .search-box .search-fields */

/* .search-fields > div is now .search-box .search-fields > div */

/* .search-fields .button is now .search-box .button */

.search-btn { background-color: var(--accent-color); }

.search-btn:hover { background-color: #218838; }

.reset-btn { background-color: var(--dark-gray); }

.reset-btn:hover { background-color: #5a6268; }

/* .delete-all-section styling moved below */

/* #deleteAllBtn styling moved below */

.history-table .action-buttons { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-start; align-items: center; }

.history-table .action-buttons .button { font-size: 0.8em; padding: 4px 8px; }

.history-table .view-settings-btn { background-color: var(--info-color); }

.history-table .view-settings-btn:hover { background-color: #138496; }

.history-table .refill-settings-btn { background-color: var(--warning-color); }

.history-table .refill-settings-btn:hover { background-color: #e66a0a; }

.history-table .no-settings { font-style: italic; color: #999; font-size: 0.8em; padding: 4px 8px; display: inline-block; line-height: normal; vertical-align: middle; }

.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.6); }

.modal-content { background-color: #fefefe; margin: 10% auto; padding: 30px; border: 1px solid #888; width: 80%; max-width: 700px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative; }

.modal-content h4 { margin-top: 0; margin-bottom: 20px; color: var(--primary-color); border-bottom: 1px solid #eee; padding-bottom: 10px; font-size: 1.3em; }

.close-modal-btn { color: #aaa; position: absolute; left: 20px; top: 15px; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; }

.close-modal-btn:hover, .close-modal-btn:focus { color: black; text-decoration: none; }

#modalSettingsContent { background-color: #f8f9fa; border: 1px solid #e9ecef; padding: 15px; border-radius: 5px; max-height: 400px; overflow-y: auto; direction: ltr; text-align: left; font-size: 0.9em; white-space: pre-wrap; word-wrap: break-word; }

.profile-management { background-color: #e9ecef; border: 1px solid var(--border-color); padding: 12px; border-radius: 8px; margin-top: 10px; }

.profile-management h3 { text-align: center; margin-bottom: 10px; border-bottom: 1px solid #ccc; padding-bottom: 8px; color: var(--secondary-color); }

.profile-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: flex-start; }

.profile-load-delete, .profile-save { flex: 1 1 400px; display: flex; flex-direction: column; gap: 10px; }

.profile-load-delete label, .profile-save label { font-weight: 500; font-size: 1em; margin-bottom: 5px; text-align: right; }

.profile-load-delete select, .profile-save input[type="text"] { max-width: 100%; margin-bottom: 10px; }

.profile-load-delete .button { margin-top: 5px; padding: 10px 15px; font-size: 0.9em; }

.profile-save .button { padding: 10px 15px; font-size: 0.9em; background-color: var(--accent-color); }

.profile-save .button:hover { background-color: #218838; }

#profileFeedback { text-align: center; font-weight: bold; }

.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-top: 20px; }

.stat-card { background-color: var(--white); padding: 25px; border-radius: 10px; box-shadow: var(--shadow-light); border: 1px solid var(--border-color); }

.stat-card h4 { margin-top: 0; margin-bottom: 20px; color: var(--secondary-color); border-bottom: 1px solid #eee; padding-bottom: 10px; font-size: 1.2em; text-align: right; }

.stat-card ul { list-style: none; padding: 0; margin: 0; text-align: right; }

.stat-card li { margin-bottom: 10px; font-size: 1.05em; color: var(--text-dark); }

.stat-card li strong { color: var(--primary-color); font-weight: 600; margin-right: 5px; }

.stat-card p { color: var(--text-light); font-style: italic; }

.settings-group { border: 1px solid var(--border-color); padding: 20px; border-radius: 8px; background-color: #fdfdfd; margin-bottom: 20px; }

.settings-group label { display: block; margin-bottom: 8px; }

.settings-group .checkbox-group label.inline-label { display: inline-block; margin-bottom: 0; }

.settings-group select { max-width: 300px; display: block; margin-right: 0; margin-left: auto; margin-bottom: 10px; }

.setting-description { font-size: 0.9em; color: var(--text-light); margin-top: 5px; margin-right: 25px; text-align: right; }

footer { margin-top: 45px; padding: 25px; font-size: 1em; color: var(--dark-gray); border-top: 1px solid var(--border-color); background-color: var(--medium-gray); }

footer .brand { color: var(--elias-net-color); font-weight: bold; background-color: transparent; padding: 0; box-shadow: none;}



/* --- START: Styles for History Page Search Reorganization (v2) --- */



.search-container {

    display: flex;          /* Use flexbox for layout */

    flex-wrap: wrap;        /* Allow items to wrap onto the next line */

    gap: 20px;              /* Space between search boxes */

    margin-bottom: 25px;

    padding: 20px;

    background-color: #f8f9fa; /* Light background for the container */

    border: 1px solid var(--border-color);

    border-radius: 8px;

    /* justify-content: space-between; /* Removed for potentially better wrapping */

}



.search-box {

    flex: 1 1 320px; /* Allow boxes to grow, base width 320px, allow shrinking */

    min-width: 280px; /* Prevent boxes from becoming too small */

    padding: 20px;

    border: 1px solid #dee2e6; /* Border for individual boxes */

    border-radius: 6px;

    background-color: #fff; /* White background for boxes */

    display: flex; /* Use flexbox for internal layout */

    flex-direction: column;

    box-shadow: var(--shadow-light); /* Add subtle shadow */

}



.search-box h4 {

    margin-top: 0;

    margin-bottom: 15px;

    font-size: 1.1em;

    color: var(--secondary-color);

    border-bottom: 1px solid #eee;

    padding-bottom: 8px;

    text-align: center;

}



/* Ensure form fills the box */

.search-box form {

     display: flex;

     flex-direction: column;

     flex-grow: 1; /* Make form take available vertical space */

     height: 100%;

}



/* Style the fields area */

.search-box .search-fields {

    display: flex;

    flex-direction: column;

    gap: 12px; /* Space between fields */

    flex-grow: 1; /* Allow this area to grow, pushing buttons down */

}



/* Stack label above input */

 .search-box .search-fields > div {

     display: flex;

     flex-direction: column;

 }



.search-box label {

    font-size: 0.9em;

    margin-bottom: 4px;

    text-align: right;

    color: var(--text-light);

    font-weight: 500; /* Make labels slightly bolder */

}



/* Style inputs and selects within the search box */

.search-box input,

.search-box select {

    width: 100%;

    max-width: none;

    padding: 9px 12px;

    font-size: 0.95em;

    margin-bottom: 5px;

    border-radius: 6px;

    border: 1px solid var(--border-color);

    box-sizing: border-box; /* Include padding and border in element's total width/height */

}



/* Style the button group */

.search-box .button-group {

    display: flex;

    gap: 10px;

    margin-top: auto; /* Push buttons to the bottom */

    padding-top: 15px; /* Add space above buttons */

}



/* Style buttons within the group */

.search-box .button {

    flex-grow: 1;

    padding: 9px 15px;

    font-size: 0.95em;

}



/* Style the delete all section */

.delete-all-section {

    width: 100%;

    text-align: left; /* Align button to the left */

    margin-top: 20px;

    padding-top: 15px;

    border-top: 1px dashed #ccc;

}



#deleteAllBtn {

     padding: 8px 15px;

     font-size: 0.9em;

     width: auto;

     display: inline-block;

     background-color: var(--danger-color);

}

#deleteAllBtn:hover {

    background-color: #c82333;

}



/* --- END: Styles for History Page Search Reorganization (v2) --- */



/* --- START: Pagination Styles (Copied from history.php) --- */

.pagination { text-align: center; margin: 30px 0 10px 0; }

.pagination a, .pagination span { display: inline-block; padding: 8px 14px; margin: 0 3px; border: 1px solid var(--border-color); border-radius: 4px; text-decoration: none; color: var(--primary-color); background-color: var(--white); transition: background-color 0.2s, color 0.2s; }

.pagination a:hover { background-color: var(--primary-color); color: var(--white); }

.pagination .current-page { background-color: var(--primary-color); color: var(--white); font-weight: bold; border-color: var(--primary-color); }

.pagination .disabled { color: #aaa; border-color: #ddd; cursor: not-allowed; background-color: #f9f9f9; }

/* --- END: Pagination Styles --- */



/* --- START: Card View Styles (Copied from history.php) --- */

.cards-container { display: none; padding: 15px; margin-top: -1px; background-color: #f0f8ff; border: 1px solid #bee5eb; border-top: none; border-radius: 0 0 5px 5px; }

.cards-container.visible { display: block; }

.cards-container h5 { margin-top: 0; margin-bottom: 10px; color: var(--secondary-color); font-size: 1.1em; }

.cards-container ul { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; font-family: monospace; font-size: 0.9em; direction: ltr; text-align: left; border: 1px solid #ddd; background-color: #fff; padding: 10px; border-radius: 4px; }

.cards-container li { padding: 3px 0; border-bottom: 1px dashed #eee; }

.cards-container li:last-child { border-bottom: none; }

.cards-container .loading, .cards-container .error { text-align: center; padding: 10px; color: var(--text-light); font-style: italic; }

.cards-container .password-col { color: #e83e8c; margin-left: 15px; }

.history-table th:last-child, .history-table td:last-child { /* width: 25%; */ width: auto; }

.history-table th:nth-last-child(2), .history-table td:nth-last-child(2) { width: 120px; text-align: center; }

.view-cards-btn { font-size: 0.8em !important; padding: 3px 6px !important; background-color: var(--dark-gray); }

.view-cards-btn:hover { background-color: #5a6268; }

.view-cards-btn .spinner { width: 0.8em; height: 0.8em; border-width: 1.5px; }

.plaintext-warning { color: var(--danger-color); font-weight: bold; font-size: 0.9em; margin-top: 5px; text-align: center; }

.card-search-results-table { margin-top: 20px; }

.card-search-results-table th { background-color: var(--secondary-color); }

.card-search-results-table td:nth-child(2) { color: #e83e8c; }

.action-buttons button, .action-buttons .button { margin: 2px !important; }

/* --- END: Card View Styles --- */





/* Responsive Overrides */

@media (max-width: 1200px) { .preview-layout-container { grid-template-columns: 1fr; } .interactive-preview-area { padding: 12px; gap: 8px; } .step3-layout { grid-template-columns: 1fr; } .step3-preview-col, .step3-side-col { max-width: 460px; justify-self: center; } .settings-grid { grid-template-columns: 1fr; grid-template-areas: "layout" "mikrotik" "qr"; } }

@media (max-width: 992px) { .profile-controls { flex-direction: column; gap: 8px; align-items: stretch;} .profile-load-delete, .profile-save { flex-basis: auto; } }

@media (max-width: 768px) {

    body { font-size: 15px;}

    .container { width: 98%; padding: 12px; margin: 8px auto; }

    h1 { font-size: 1.8em; }

    h1 .brand { font-size: 0.8em; }

    .settings-grid { grid-template-columns: 1fr; }

    button, .button { padding: 11px 22px; font-size: 1em; }

    .input-with-button { flex-wrap: wrap; }

    .auto-calc-btn { width: 100%; margin-right: 0; margin-top: 5px;}

    .header-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 15px; padding: 0 15px; }

    /* .search-fields { flex-direction: column; align-items: stretch;} */ /* Handled by search-box */

    /* .search-fields > div { flex-basis: auto; } */ /* Handled by search-box */

    .modal-content { width: 90%; margin: 15% auto;}

    /* .history-controls { flex-direction: column; align-items: stretch;} */ /* Replaced by search-container */

    .delete-all-section { text-align: left; margin-top: 10px;} /* Adjusted alignment */

    .search-container { flex-direction: column; } /* Stack search boxes */

    .search-box { min-width: unset; }

}

@media (max-width: 480px) {

    body { font-size: 14px;}

    h1 { font-size: 1.5em; }

    #design-container { max-width: 300px; }


    button, .button { width: calc(50% - 12px); margin: 6px; font-size: 0.95em; padding: 10px 15px;}

    .button-group button:first-child { width: calc(100% - 12px); }

    .history-table .action-buttons .button { width: calc(50% - 6px); }

    .history-table .action-buttons .button:last-child { width: 100%; }

    .modal-content { padding: 20px;}

    .search-fields .button { width: auto; /* Allow buttons to shrink */}

    .profile-load-delete .button { width: 100%; margin-top: 10px;}

    .header-controls { position: static; margin-top: 10px; justify-content: center; } /* Make it static */

    .header-controls .button { padding: 5px 8px; }

    .container { padding: 10px; }

    .main-section { padding: 15px; }

    .search-box .button { width: 100%; } /* Make search buttons full width */

    .search-box .button-group { flex-direction: column; } /* Stack buttons in search */

}



