/* FAX Portal - CSS */
:root {
    --primary: #00876D;
    --primary-dark: #006d58;
    --secondary: #152735;
    --accent: #9EF3A0;
    --background: #FFF9F2;
    --white: #ffffff;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
    --info: #17a2b8;

    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--background);
    color: var(--secondary);
    min-height: 100vh;
    direction: ltr;
    text-align: left;
}

/* RTL Support for Hebrew */
body.lang-he {
    direction: rtl;
    text-align: right;
}

.hidden { display: none !important; }

/* ==================== Auth Screen ==================== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Fax-themed background pattern */
.auth-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background-image: url('../img/fax-bg-pattern.svg');
    background-size: 250px 250px;
    background-repeat: repeat;
    opacity: 1;
    animation: bgScroll 80s linear infinite;
    pointer-events: none;
}

@keyframes bgScroll {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 200px 200px;
    }
}

/* Decorative floating elements */
.auth-screen::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    z-index: 0;
    background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .auth-screen::before {
        background-size: 180px 180px;
    }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-subtitle {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 400;
}

.auth-lang-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 3px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.auth-lang-selector .lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 17px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    color: rgba(255,255,255,0.8);
}

.auth-lang-selector .lang-btn.active {
    background: var(--white);
    color: var(--primary);
}

.auth-lang-selector .lang-btn:hover:not(.active) {
    background: rgba(255,255,255,0.1);
}

.auth-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-domain {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 5px;
    margin-bottom: 20px;
}

.auth-domain i {
    font-size: 12px;
    opacity: 0.9;
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

body.lang-he .password-input-wrapper input {
    padding-right: 15px;
    padding-left: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.2s ease;
}

body.lang-he .password-toggle {
    right: auto;
    left: 12px;
}

.password-toggle:hover {
    color: var(--primary);
}

.password-toggle.active {
    color: var(--primary);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.auth-logo .login-logo {
    max-width: 180px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Fallback for icon (if no image) */
.auth-logo i {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--white);
}

.auth-box h1 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--secondary);
}

.auth-subtitle {
    color: var(--gray);
    margin-bottom: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary);
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.otp-info {
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.otp-info i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

.otp-info p {
    margin: 5px 0;
}

.otp-info .he {
    color: var(--gray);
    font-size: 14px;
}

.otp-input {
    text-align: center;
    font-size: 32px !important;
    letter-spacing: 10px;
    font-weight: 600;
}

.error-message {
    color: var(--danger);
    margin-top: 15px;
    font-size: 14px;
}

.success-message {
    color: var(--success);
    margin-top: 15px;
    font-size: 14px;
    background: rgba(40, 167, 69, 0.1);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

/* Forgot Password */
.forgot-password-link {
    margin-top: 20px;
    text-align: center;
}

.forgot-password-link a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.forgot-password-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.forgot-password-link .link-separator {
    margin: 0 10px;
    color: var(--gray);
}

.back-to-login {
    margin-bottom: 20px;
    text-align: left;
}

body.lang-he .back-to-login {
    text-align: right;
}

.back-to-login a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.back-to-login a:hover {
    color: var(--primary);
}

#forgotPasswordForm h3 {
    color: var(--secondary);
    margin-bottom: 10px;
    font-size: 20px;
}

#forgotPasswordForm .form-description,
#resetPasswordForm .form-description {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

#resetPasswordForm h3 {
    color: var(--secondary);
    margin-bottom: 10px;
    font-size: 20px;
}

.reset-for-user {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 20px;
    font-size: 14px;
}

.password-requirements {
    background: var(--gray-light);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: left;
}

body.lang-he .password-requirements {
    text-align: right;
}

.password-requirements p {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    font-size: 12px;
    color: var(--gray);
    padding: 2px 0;
    padding-left: 18px;
    position: relative;
}

body.lang-he .password-requirements li {
    padding-left: 0;
    padding-right: 18px;
}

.password-requirements li::before {
    content: "•";
    position: absolute;
    left: 5px;
    color: var(--primary);
}

body.lang-he .password-requirements li::before {
    left: auto;
    right: 5px;
}

/* ==================== Buttons ==================== */
.btn-primary, .btn-secondary, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #dee2e6;
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* ==================== Portal Layout ==================== */
.portal {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--secondary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: auto;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

body.lang-he .sidebar {
    left: auto;
    right: 0;
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header i {
    font-size: 28px;
    color: var(--accent);
}

.user-info {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar i {
    font-size: 45px;
    color: var(--accent);
}

.user-name {
    font-weight: 600;
    display: block;
}

.user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 10px;
}

.nav-section-title {
    display: block;
    padding: 10px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    border-right: none;
}

body.lang-he .nav-item {
    border-left: none;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--accent);
}

body.lang-he .nav-item.active {
    border-left-color: transparent;
    border-right-color: var(--accent);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    margin-right: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.lang-he .main-content {
    margin-left: 0;
    margin-right: 280px;
}

.header {
    background: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary);
}

.current-time {
    color: var(--gray);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Language Selector */
.lang-selector {
    display: flex;
    background: var(--gray-light);
    border-radius: 20px;
    padding: 3px;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 17px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    color: var(--gray);
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.lang-btn:hover:not(.active) {
    background: rgba(0,0,0,0.05);
}

/* ==================== Language Display ==================== */

/* Default - English LTR */
body.lang-en [data-lang="he"],
body.lang-en .lang-he-only {
    display: none !important;
}

/* Hebrew RTL */
body.lang-he [data-lang="en"],
body.lang-he .lang-en-only {
    display: none !important;
}

/* Tables - align based on language */
body.lang-en th,
body.lang-en td {
    text-align: left;
}

body.lang-he th,
body.lang-he td {
    text-align: right;
}

/* Info box border */
.info-box {
    border-left: 4px solid var(--primary);
    border-right: none;
}

body.lang-he .info-box {
    border-left: none;
    border-right: 4px solid var(--primary);
}

/* Warning box border */
.warning-box {
    border-left: 4px solid var(--warning);
    border-right: none;
}

body.lang-he .warning-box {
    border-left: none;
    border-right: 4px solid var(--warning);
}

/* Doc intro border */
.doc-intro {
    border-left: 4px solid var(--primary);
    border-right: none;
}

body.lang-he .doc-intro {
    border-left: none;
    border-right: 4px solid var(--primary);
}

/* Doc block important/warning */
.doc-block.important {
    border-left: 4px solid var(--primary);
    border-right: none;
}

body.lang-he .doc-block.important {
    border-left: none;
    border-right: 4px solid var(--primary);
}

.doc-block.warning {
    border-left: 4px solid var(--warning);
    border-right: none;
}

body.lang-he .doc-block.warning {
    border-left: none;
    border-right: 4px solid var(--warning);
}

/* Security stats cards */
.security-stats .stat-card.warning {
    border-left: 4px solid var(--warning);
    border-right: none;
}

body.lang-he .security-stats .stat-card.warning {
    border-left: none;
    border-right: 4px solid var(--warning);
}

.security-stats .stat-card.danger {
    border-left: 4px solid var(--danger);
    border-right: none;
}

body.lang-he .security-stats .stat-card.danger {
    border-left: none;
    border-right: 4px solid var(--danger);
}

/* Action buttons margin */
.action-btn {
    margin-right: 5px;
    margin-left: 0;
}

body.lang-he .action-btn {
    margin-right: 0;
    margin-left: 5px;
}

/* Status badge online */
.status-badge.online {
    margin-right: 5px;
    margin-left: 0;
}

body.lang-he .status-badge.online {
    margin-right: 0;
    margin-left: 5px;
}

/* Ordered list numbers position */
ol.doc-list li {
    padding-left: 35px;
    padding-right: 0;
}

body.lang-he ol.doc-list li {
    padding-left: 0;
    padding-right: 35px;
}

ol.doc-list li::before {
    left: 0;
    right: auto;
}

body.lang-he ol.doc-list li::before {
    left: auto;
    right: 0;
}

/* Check list padding */
.doc-list.check-list li .he {
    padding-left: 25px;
    padding-right: 0;
}

body.lang-he .doc-list.check-list li .he {
    padding-left: 0;
    padding-right: 25px;
}

/* Email field label margin */
.email-field strong {
    margin-right: 10px;
    margin-left: 0;
}

body.lang-he .email-field strong {
    margin-right: 0;
    margin-left: 10px;
}

.content {
    flex: 1;
    padding: 30px;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 i {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary);
}

.card-body {
    padding: 20px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.incoming { background: rgba(0, 135, 109, 0.1); color: var(--primary); }
.stat-icon.outgoing { background: rgba(23, 162, 184, 0.1); color: var(--info); }
.stat-icon.success { background: rgba(40, 167, 69, 0.1); color: var(--success); }
.stat-icon.keys { background: rgba(255, 193, 7, 0.1); color: var(--warning); }
.stat-icon.warning { background: rgba(255, 193, 7, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.stat-icon.credits { background: rgba(155, 89, 182, 0.1); color: #9b59b6; }

/* Credits Stats Layout */
.credits-stats, .cdr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

/* Credits Badge */
.credits-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.credits-badge.has-credits {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.credits-badge.no-credits {
    background: var(--gray-light);
    color: var(--gray);
}

/* Credits Button Styles */
.btn-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.btn-icon.success:hover {
    background: var(--success);
    color: white;
}

.btn-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.btn-icon.warning:hover {
    background: var(--warning);
    color: #212529;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #e0a800 100%);
    color: #212529;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #c69500 100%);
    transform: translateY(-1px);
}

/* CDR Table Styles */
#cdrTable td code {
    background: var(--gray-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Status badges for CDR */
.status-badge.outgoing {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.status-badge.incoming {
    background: rgba(0, 135, 109, 0.1);
    color: var(--primary);
}

.status-badge.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-badge.failed {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.status-badge.info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

/* Card header with button */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray);
    font-size: 14px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-light);
}

th {
    background: var(--background);
    font-weight: 600;
    font-size: 13px;
    color: var(--gray);
    text-transform: uppercase;
}

tr:hover {
    background: rgba(0, 135, 109, 0.02);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
}

.tab {
    padding: 10px 20px;
    background: var(--gray-light);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.tab.active {
    background: var(--primary);
    color: var(--white);
}

.tab:hover:not(.active) {
    background: #dee2e6;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Forms */
.form-control {
    padding: 10px 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--gray);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload label:hover {
    border-color: var(--primary);
    background: rgba(0, 135, 109, 0.02);
}

.file-upload label i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-name {
    display: block;
    margin-top: 10px;
    color: var(--primary);
    font-weight: 500;
}

/* Info Box */
.info-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 135, 109, 0.05);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.info-box i {
    font-size: 24px;
    color: var(--primary);
}

.info-box code {
    background: var(--white);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.info-box .he {
    color: var(--gray);
    font-size: 13px;
    margin-top: 5px;
}

/* Warning/Success Boxes */
.warning-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.warning-box i {
    font-size: 24px;
    color: var(--warning);
}

.warning-text {
    color: var(--warning);
}

.success-text {
    color: var(--success);
}

/* Key Display */
.key-display {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

.key-display code,
.credential-item code,
.secret-code {
    direction: ltr !important;
    text-align: left !important;
}

.key-display code {
    flex: 1;
    padding: 15px;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-size: 14px;
    word-break: break-all;
}

/* Profile */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.profile-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.profile-avatar i {
    font-size: 80px;
    color: var(--primary);
}

.profile-details p {
    margin: 10px 0;
}

/* OTP Setup */
.otp-setup {
    text-align: center;
}

.otp-setup p {
    margin: 10px 0;
}

.otp-setup .he {
    color: var(--gray);
    font-size: 13px;
}

.qr-code {
    margin: 20px 0;
}

.qr-code img {
    max-width: 200px;
    border-radius: var(--radius-sm);
}

.secret-code {
    display: block;
    padding: 15px;
    background: var(--background);
    border-radius: var(--radius-sm);
    margin: 15px 0;
    font-size: 18px;
    letter-spacing: 3px;
}

/* Security Stats */
.security-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active, .status-badge.success { background: rgba(40, 167, 69, 0.1); color: var(--success); }
.status-badge.inactive, .status-badge.failed { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.status-badge.pending { background: rgba(255, 193, 7, 0.1); color: #856404; }
.status-badge.blocked { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.status-badge.admin { background: rgba(0, 135, 109, 0.1); color: var(--primary); }
.status-badge.customer { background: rgba(108, 117, 125, 0.1); color: var(--gray); }
.status-badge.info { background: rgba(23, 162, 184, 0.1); color: var(--info); }
.status-badge.warning { background: rgba(255, 193, 7, 0.1); color: #856404; }
.status-badge.critical { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.status-badge.online { background: rgba(40, 167, 69, 0.1); color: var(--success); }
.status-badge.offline { background: rgba(108, 117, 125, 0.1); color: var(--gray); }

.device-ip {
    display: block;
    font-size: 11px;
    color: var(--gray);
    margin-top: 3px;
}

/* Device Configuration Grid */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-item label {
    font-weight: 500;
    color: var(--dark);
    font-size: 13px;
}

.config-item code {
    background: var(--light);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--primary);
}

/* Credentials Display */
.credentials-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.credential-item label {
    min-width: 100px;
    font-weight: 500;
    color: var(--gray);
}

.credential-item code {
    flex: 1;
    background: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--primary);
    border: 1px solid var(--border);
}

.copy-btn {
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--primary-dark);
}

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert i {
    font-size: 20px;
    margin-top: 2px;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.alert-warning i {
    color: #ffc107;
}

/* Form Row for checkboxes */
.form-row {
    display: flex;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Action Buttons */
.action-btn {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
}

.action-btn.view { background: rgba(23, 162, 184, 0.1); color: var(--info); }
.action-btn.edit { background: rgba(255, 193, 7, 0.1); color: #856404; }
.action-btn.delete { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.action-btn.block { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.action-btn.unblock { background: rgba(40, 167, 69, 0.1); color: var(--success); }

.action-btn:hover {
    opacity: 0.8;
}

/* Result Message */
.result-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.result-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.result-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

.modal form {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Device Modal Enhanced Styling */
.device-modal .modal-content {
    max-width: 550px;
}

.device-modal .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1a5a8a 100%);
    color: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 25px;
}

.device-modal .modal-header h3 {
    color: var(--white);
    font-size: 20px;
}

.device-modal .modal-header h3 i {
    color: var(--white);
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 50%;
}

.device-modal .close-btn {
    color: var(--white);
    opacity: 0.8;
}

.device-modal .close-btn:hover {
    opacity: 1;
    color: var(--white);
}

.device-modal .modal-body {
    padding: 25px;
}

/* Form Input Groups with Icons */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary);
    font-size: 14px;
}

.input-group .input-wrapper {
    position: relative;
}

.input-group .input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 16px;
    z-index: 1;
}

body.lang-he .input-group .input-icon {
    left: auto;
    right: 15px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--white);
}

body.lang-he .input-group input,
body.lang-he .input-group select {
    padding: 14px 45px 14px 15px;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    outline: none;
}

.input-group input::placeholder {
    color: #adb5bd;
}

.input-group .input-hint {
    font-size: 12px;
    color: var(--gray);
    margin-top: 5px;
}

/* Readonly field style */
.readonly-field {
    background: var(--background) !important;
    color: var(--gray) !important;
    cursor: not-allowed;
}

/* Password wrapper with generate button */
.password-wrapper {
    display: flex;
    gap: 8px;
}

.password-wrapper input {
    flex: 1;
}

.btn-generate {
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-generate:hover {
    background: var(--primary);
}

.input-group .input-prefix {
    background: var(--background);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--gray);
    font-weight: 500;
}

body.lang-he .input-group .input-prefix {
    border-right: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.input-group .input-prefix + input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

body.lang-he .input-group .input-prefix + input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.radio-label:hover {
    background: var(--background);
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary);
    font-weight: 500;
}

/* Sender Type Cards */
.sender-type-card {
    transition: all 0.3s ease;
}

.sender-type-card:hover {
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sender-type-card:has(input:checked) {
    border-color: var(--primary) !important;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(33, 150, 243, 0.05)) !important;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
}

.sender-type-card:has(input[value="domain"]:checked) {
    border-color: var(--info) !important;
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1), rgba(0, 188, 212, 0.05)) !important;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.2);
}

/* RTL Support for Sender Modal */
body.lang-he .sender-type-card small {
    text-align: center;
}

body.lang-he #emailInputGroup input {
    padding: 12px 45px 12px 15px !important;
}

body.lang-he #emailInputGroup .fa-envelope {
    left: auto !important;
    right: 15px;
}

/* Modal Input Focus */
#addSenderModal input:focus,
#addSenderModal select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
    outline: none;
}

/* Toggle Switches */
.toggle-group {
    display: flex;
    gap: 20px;
    margin: 25px 0;
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.toggle-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    display: flex;
    flex-direction: column;
}

.toggle-label .toggle-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--secondary);
}

.toggle-label .toggle-desc {
    font-size: 12px;
    color: var(--gray);
}

/* Device Info Box */
.device-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.device-info-box i {
    color: var(--info);
    font-size: 20px;
    margin-top: 2px;
}

.device-info-box p {
    margin: 0;
    font-size: 13px;
    color: #1565c0;
    line-height: 1.5;
}

/* Form Actions Enhanced */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

.form-actions .btn-secondary {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
}

.form-actions .btn-primary {
    flex: 2;
    padding: 14px 20px;
    font-size: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, #1a5a8a 100%);
}

.form-actions .btn-primary:hover {
    background: linear-gradient(135deg, #1a5a8a 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Credentials Modal Enhanced */
.credentials-modal .modal-content {
    max-width: 500px;
}

.credentials-modal .modal-header {
    background: linear-gradient(135deg, var(--success) 0%, #1e7e34 100%);
    color: var(--white);
    border-radius: var(--radius) var(--radius) 0 0;
}

.credentials-modal .modal-header h3 {
    color: var(--white);
}

.credentials-modal .modal-header h3 i {
    color: var(--white);
}

.credentials-modal .close-btn {
    color: var(--white);
}

.credentials-display {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 5px;
}

.credential-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--white);
    margin: 5px;
    border-radius: var(--radius-sm);
    gap: 10px;
}

.credential-item label {
    min-width: 100px;
    font-weight: 600;
    color: var(--gray);
    font-size: 13px;
}

.credential-item code {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary);
    background: transparent;
    padding: 0;
}

.credential-item .copy-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.credential-item .copy-btn:hover {
    background: #1a5a8a;
    transform: scale(1.05);
}

/* Alert Warning Enhanced */
.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.alert-warning i {
    color: #d39e00;
    font-size: 24px;
}

.alert-warning strong {
    color: #856404;
    display: block;
    margin-bottom: 5px;
}

.alert-warning p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary);
    color: var(--white);
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}

.badge-success { background: rgba(40, 167, 69, 0.15); color: var(--success); }
.badge-info { background: rgba(23, 162, 184, 0.15); color: var(--info); }
.badge-primary { background: rgba(0, 123, 255, 0.15); color: var(--primary); }
.badge-warning { background: rgba(255, 193, 7, 0.15); color: #d39e00; }
.badge-danger { background: rgba(220, 53, 69, 0.15); color: var(--danger); }
.badge.incoming { background: rgba(40, 167, 69, 0.15); color: var(--success); }
.badge.outgoing { background: rgba(0, 123, 255, 0.15); color: var(--primary); }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-icon {
    background: var(--background);
    border: 1px solid var(--gray-light);
    color: var(--secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.btn-icon.success:hover {
    background: var(--success);
    border-color: var(--success);
}

.btn-icon.warning:hover {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--secondary);
}

.btn-icon.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Expand Button for FAX Numbers */
.btn-expand {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 5px 10px 5px 0;
    transition: transform 0.2s;
}

.btn-expand:hover {
    color: var(--primary-dark);
}

.btn-expand i {
    transition: transform 0.2s;
}

/* FAX Number Details Row */
.fax-number-details {
    background: var(--background);
}

.fax-number-details.hidden {
    display: none;
}

.senders-panel {
    border-left: 3px solid var(--primary);
    margin: 0 10px;
}

.senders-table th {
    font-weight: 600;
    font-size: 13px;
    color: var(--secondary);
}

.senders-table td {
    font-size: 14px;
}

.senders-table tr:hover {
    background: var(--light-bg);
}

/* RTL Support for Expand */
body.lang-he .btn-expand {
    padding: 5px 0 5px 10px;
}

body.lang-he .senders-panel {
    border-left: none;
    border-right: 3px solid var(--primary);
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.activity-icon.success { background: rgba(40, 167, 69, 0.1); color: var(--success); }
.activity-icon.failed { background: rgba(220, 53, 69, 0.1); color: var(--danger); }

.activity-info {
    flex: 1;
}

.activity-info strong {
    display: block;
}

.activity-info span {
    font-size: 12px;
    color: var(--gray);
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    body.lang-he .sidebar {
        transform: translateX(100%);
    }

    body.lang-he .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        margin-right: 0;
    }

    body.lang-he .main-content {
        margin-left: 0;
        margin-right: 0;
    }

    .menu-toggle {
        display: block;
    }

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

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

@media (max-width: 576px) {
    .content {
        padding: 15px;
    }

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

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filters .form-control {
        flex: 1;
    }

    th, td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ==================== Documentation Styles ==================== */

.docs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.doc-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--secondary);
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.doc-nav-item:hover {
    background: var(--primary);
    color: var(--white);
}

.doc-nav-item i {
    font-size: 16px;
}

.doc-section {
    margin-bottom: 25px;
}

/* Documentation: LTR for English, RTL for Hebrew */
body.lang-en .doc-section,
body.lang-en .doc-section * {
    direction: ltr;
    text-align: left;
}

body.lang-he .doc-section,
body.lang-he .doc-section * {
    direction: rtl;
    text-align: right;
}

/* Code blocks always LTR */
.doc-section pre,
.doc-section code {
    direction: ltr !important;
    text-align: left !important;
}

.doc-intro {
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.doc-intro p {
    margin: 8px 0;
}

.doc-intro .he {
    color: var(--gray);
}

.doc-block {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--gray-light);
}

.doc-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.doc-block h4 {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
}

.doc-block h4 i {
    color: var(--primary);
}

.doc-block.important {
    background: rgba(0, 135, 109, 0.05);
    padding: 20px;
    border-radius: var(--radius-sm);
}

.doc-block.warning {
    background: rgba(255, 193, 7, 0.08);
    padding: 20px;
    border-radius: var(--radius-sm);
}

.doc-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.doc-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-number {
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary);
}

.step-content p {
    margin: 3px 0;
    color: var(--gray);
    font-size: 14px;
}

.step-content .he {
    font-size: 13px;
}

.doc-list {
    list-style: none;
    padding: 0;
}

.doc-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.doc-list li:last-child {
    border-bottom: none;
}

.doc-list li .he {
    color: var(--gray);
    font-size: 13px;
}

.doc-list.check-list li {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.doc-list.check-list li i {
    color: var(--success);
    margin-top: 3px;
}

.doc-list.check-list li .he {
    width: 100%;
    padding-right: 25px;
}

ol.doc-list {
    counter-reset: doc-counter;
}

ol.doc-list li {
    counter-increment: doc-counter;
    position: relative;
}

ol.doc-list li::before {
    content: counter(doc-counter);
    position: absolute;
    top: 10px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.doc-example {
    margin-top: 20px;
    background: var(--background);
    padding: 15px;
    border-radius: var(--radius-sm);
}

.doc-example h5 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--gray);
}

.doc-example pre {
    margin: 0;
    background: var(--secondary);
    color: #f8f8f2;
    padding: 15px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    /* Always LTR for code - תמיד משמאל לימין לקוד */
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
}

.doc-example code {
    font-family: 'Consolas', 'Monaco', monospace;
    /* Always LTR for code */
    direction: ltr !important;
    text-align: left !important;
}

/* All code blocks should be LTR - כל בלוקי הקוד צריכים להיות משמאל לימין */
pre, code {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
}

/* Documentation notes */
.doc-note {
    margin-top: 15px;
    padding: 12px 15px;
    background: var(--info-light, #e3f2fd);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--info, #1976d2);
}

.doc-note i {
    margin-right: 8px;
}

body.lang-he .doc-note i {
    margin-right: 0;
    margin-left: 8px;
}

/* Mail to Fax Format Box */
.mail-to-fax-format {
    text-align: center;
    padding: 20px;
}

.format-box {
    margin-bottom: 15px;
}

.format-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

.format-email {
    display: inline-block;
    font-size: 22px;
    padding: 15px 25px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--primary);
}

.format-email .fax-dest {
    color: var(--info);
}

.format-email .fax-domain {
    color: var(--primary);
}

.format-example {
    margin-top: 15px;
}

.format-example code {
    font-size: 18px;
    color: var(--primary);
}

/* Email Preview */
.email-examples {
    margin-top: 15px;
}

.email-example h5 {
    margin-bottom: 10px;
    color: var(--gray);
}

.email-preview {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.email-field {
    padding: 10px 15px;
    border-bottom: 1px solid var(--gray-light);
    font-size: 14px;
}

.email-field:last-child {
    border-bottom: none;
}

.email-field strong {
    color: var(--gray);
}

/* Documentation Tables */
.doc-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-table th,
.doc-table td {
    padding: 12px 15px;
    border: 1px solid var(--gray-light);
}

.doc-table th {
    background: var(--background);
    font-weight: 600;
}

/* Code in tables always LTR - קוד בטבלאות תמיד משמאל לימין */
.doc-table code,
.doc-table pre,
.doc-table td:nth-child(2),
.doc-table td:nth-child(3) {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed;
}

.doc-table .method {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.doc-table .method.get {
    background: var(--primary);
    color: var(--white);
}

.doc-table .method.post {
    background: var(--warning);
    color: var(--secondary);
}

.doc-table .method.put {
    background: var(--info);
    color: var(--white);
}

.doc-table .method.delete {
    background: var(--danger);
    color: var(--white);
}

/* Base URL Display */
.base-url {
    display: block;
    padding: 15px;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

.number-format {
    display: block;
    padding: 15px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 20px;
    text-align: center;
    letter-spacing: 2px;
}

/* Responsive adjustments for docs */
@media (max-width: 768px) {
    .docs-nav {
        flex-direction: column;
    }

    .doc-nav-item {
        width: 100%;
    }

    .format-email {
        font-size: 16px;
        padding: 10px 15px;
    }

    .doc-step {
        flex-direction: column;
    }

    .step-number {
        margin-bottom: 10px;
    }

    /* Modal responsive */
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .toggle-group {
        flex-direction: column;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-secondary,
    .form-actions .btn-primary {
        flex: none;
        width: 100%;
    }

    .credential-item {
        flex-wrap: wrap;
    }

    .credential-item label {
        min-width: 100%;
        margin-bottom: 5px;
    }

    .credential-item code {
        flex: 1;
    }
}

/* ==================== Settings Page ==================== */

.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-card .card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 15px 20px;
}

.settings-card .card-header h3 {
    color: white;
    margin: 0;
    font-size: 16px;
}

.settings-card .card-header h3 i {
    margin-right: 10px;
}

body.lang-he .settings-card .card-header h3 i {
    margin-right: 0;
    margin-left: 10px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-item label {
    font-weight: 600;
    color: var(--secondary);
    font-size: 14px;
}

.setting-item small {
    color: var(--gray);
    font-size: 12px;
}

.setting-item .form-control {
    padding: 10px 14px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
}

.setting-item .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 135, 109, 0.1);
    outline: none;
}

.setting-item.toggle-setting {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

.setting-item.toggle-setting:last-child {
    border-bottom: none;
}

/* Toggle Switch for Settings */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Settings Page Header */
#settingsPage .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .settings-container {
        grid-template-columns: 1fr;
    }

    .setting-item.toggle-setting {
        flex-wrap: wrap;
    }
}

/* ==================== Supported Codecs Box ==================== */

.supported-codecs-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 20px;
}

.supported-codecs-box h4 {
    margin: 0 0 15px 0;
    color: var(--secondary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.supported-codecs-box h4 i {
    color: var(--primary);
}

.codec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.codec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--gray-light);
    transition: all 0.2s ease;
}

.codec-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 135, 109, 0.1);
}

.codec-item.primary {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 135, 109, 0.05) 0%, rgba(158, 243, 160, 0.1) 100%);
}

.codec-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    padding: 6px 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: 12px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.codec-item.primary .codec-badge {
    background: linear-gradient(135deg, #00876D 0%, #006d58 100%);
    box-shadow: 0 2px 6px rgba(0, 135, 109, 0.3);
}

.codec-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.codec-info strong {
    color: var(--secondary);
    font-size: 13px;
}

.codec-info span {
    color: var(--gray);
    font-size: 11px;
}

.codec-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(0, 135, 109, 0.08);
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary-dark);
}

.codec-note i {
    color: var(--warning);
    margin-top: 2px;
}

@media (max-width: 480px) {
    .codec-list {
        gap: 8px;
    }

    .codec-item {
        flex-wrap: wrap;
    }

    .codec-badge {
        min-width: 50px;
        font-size: 11px;
    }
}

/* ==================== Low Credits Alerts ==================== */
.alerts-container {
    margin-bottom: 20px;
}

.alert {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.alert-warning {
    border-right: 4px solid var(--warning);
}

body.lang-he .alert-warning {
    border-right: none;
    border-left: 4px solid var(--warning);
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border-bottom: 1px solid rgba(255, 193, 7, 0.2);
}

.alert-header i {
    font-size: 24px;
    color: var(--warning);
}

.alert-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary);
}

.alert-body {
    padding: 20px;
}

.low-credits-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.low-credit-user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-light);
    transition: var(--transition);
}

.low-credit-user-card:hover {
    border-color: var(--warning);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.low-credit-user-card.zero-credits {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05) 0%, rgba(220, 53, 69, 0.02) 100%);
}

.low-credit-user-card.zero-credits:hover {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.user-credit-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--white);
    flex-shrink: 0;
}

.user-credit-avatar.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #e0a800 100%);
}

.user-credit-avatar.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
}

.user-credit-info {
    flex: 1;
    min-width: 0;
}

.user-credit-info strong {
    display: block;
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-credit-info .credit-amount {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
}

.user-credit-info .credit-amount.low {
    color: var(--warning);
}

.user-credit-info .credit-amount.zero {
    color: var(--danger);
}

.user-credit-actions {
    display: flex;
    gap: 8px;
}

.user-credit-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

@media (max-width: 768px) {
    .low-credits-list {
        grid-template-columns: 1fr;
    }

    .low-credit-user-card {
        flex-wrap: wrap;
    }

    .user-credit-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }
}

/* ==================== System Page ==================== */
.sys-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.info-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card-header i {
    font-size: 20px;
    opacity: 0.9;
}

.info-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.info-card-body {
    padding: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    color: var(--gray);
    font-size: 14px;
}

.info-row span:last-child,
.info-row strong {
    font-weight: 500;
    color: var(--secondary);
}

/* Disk Progress */
.disk-progress {
    margin-bottom: 15px;
}

.disk-bar {
    height: 12px;
    background: var(--gray-light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.disk-used {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--warning) 70%, var(--danger) 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.disk-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
}

/* Version History */
.version-history {
    padding: 20px;
}

.version-item {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
}

.version-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.version-number {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.version-date {
    color: var(--gray);
    font-size: 13px;
}

.version-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-changes li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: var(--secondary);
    font-size: 14px;
}

body.lang-he .version-changes li {
    padding-left: 0;
    padding-right: 20px;
}

.version-changes li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

body.lang-he .version-changes li::before {
    left: auto;
    right: 0;
}

/* Technical Docs */
.tech-docs-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-top: 20px;
}

.markdown-content {
    font-size: 14px;
    line-height: 1.7;
}

.markdown-content h1 {
    font-size: 24px;
    color: var(--secondary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-top: 30px;
}

.markdown-content h2 {
    font-size: 20px;
    color: var(--secondary);
    margin-top: 25px;
    margin-bottom: 15px;
}

.markdown-content h3 {
    font-size: 16px;
    color: var(--primary);
    margin-top: 20px;
}

.markdown-content pre {
    background: var(--secondary);
    color: #f8f8f2;
    padding: 15px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    margin: 15px 0;
}

.markdown-content code {
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 13px;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid var(--gray-light);
    padding: 10px 12px;
    text-align: left;
}

body.lang-he .markdown-content th,
body.lang-he .markdown-content td {
    text-align: right;
}

.markdown-content th {
    background: var(--primary);
    color: white;
}

.markdown-content tr:nth-child(even) {
    background: #f9f9f9;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--gray-light);
    margin: 25px 0;
}

/* Backup Actions */
.backup-actions {
    display: flex;
    gap: 8px;
}

.backup-actions button {
    padding: 6px 12px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .sys-info-grid {
        grid-template-columns: 1fr;
    }

    .version-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ==================== Webhooks ==================== */

.url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-cell code {
    font-size: 11px;
    background: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.stats-text {
    font-size: 13px;
}

.stats-text .success-count {
    color: var(--success);
    font-weight: 600;
}

.stats-text .failed-count {
    color: var(--danger);
    font-weight: 600;
}

.stats-text small {
    color: var(--text-muted);
    margin-left: 3px;
}

/* Webhook Modal */
.modal-lg .modal-content {
    max-width: 700px;
}

.modal-xl .modal-content {
    max-width: 900px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.code-input {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    background: #f8f9fa;
}

.input-with-button {
    display: flex;
    gap: 10px;
}

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

.input-with-button button {
    flex-shrink: 0;
}

.toggle-group.single {
    margin: 15px 0;
}

/* Webhook Test Result Modal */
.test-result {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.test-result i {
    font-size: 48px;
    margin-bottom: 10px;
}

.test-result.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.test-result.success i {
    color: var(--success);
}

.test-result.failed {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.test-result.failed i {
    color: var(--danger);
}

.test-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    min-width: 100px;
    color: var(--text-muted);
}

.detail-row .value {
    flex: 1;
}

.detail-row .error-text {
    color: var(--danger);
}

.response-body {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 5px 0 0 0;
}

/* Webhook Logs Table */
#webhookLogsTable {
    font-size: 13px;
}

#webhookLogsTable td {
    padding: 10px 12px;
}

#webhookLogsModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-lg .modal-content,
    .modal-xl .modal-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-row .label {
        min-width: auto;
    }
}

/* System Page - LTR for English values */
#systemPage .info-row strong,
#systemPage .info-row span:not([data-i18n]),
#systemPage #sysHostname,
#systemPage #sysOS,
#systemPage #sysTime,
#systemPage #sysPHP,
#systemPage #sysVersion,
#systemPage #sysBuildDate,
#systemPage #sysBuild,
#systemPage #diskUsed,
#systemPage #diskTotal,
#systemPage #diskFree,
#systemPage #dbSize,
#systemPage #dbUsers,
#systemPage #dbFaxNumbers,
#systemPage #dbTotalFaxes,
#systemPage .disk-labels span,
#systemPage code,
#systemPage pre {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

#systemPage .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.lang-he #systemPage .info-row [data-i18n] {
    direction: rtl;
    text-align: right;
}

/* Backups table - LTR for filenames and sizes */
#backupsTableBody td:first-child,
#backupsTableBody td:nth-child(2),
#backupsTableBody td:nth-child(3) {
    direction: ltr;
    text-align: left;
}

/* Technical docs - LTR */
#technicalDocs {
    direction: ltr;
    text-align: left;
}

#technicalDocs h1,
#technicalDocs h2,
#technicalDocs h3,
#technicalDocs code,
#technicalDocs pre {
    direction: ltr;
    text-align: left;
}

/* Version history - mixed */
.version-item .version-number,
.version-item .version-date {
    direction: ltr;
}

/* System Tabs - ensure clickable */
.system-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.system-tabs .tab {
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    background: var(--gray-light);
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    transition: all 0.2s;
}

.system-tabs .tab:hover {
    background: var(--primary-light);
}

.system-tabs .tab.active {
    background: var(--primary);
    color: white;
}

.system-tabs .tab i {
    margin-right: 8px;
}

body.lang-he .system-tabs .tab i {
    margin-right: 0;
    margin-left: 8px;
}

/* Tab Content - Show/Hide */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== Firewall Page Styles ==================== */

#firewallPage .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#firewallPage .stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
}

#firewallPage .stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

#firewallPage .stat-card .stat-icon.success { background: #dcfce7; color: #16a34a; }
#firewallPage .stat-card .stat-icon.danger { background: #fee2e2; color: #dc2626; }
#firewallPage .stat-card .stat-icon.warning { background: #fef9c3; color: #ca8a04; }
#firewallPage .stat-card .stat-icon.info { background: #dbeafe; color: #2563eb; }

#firewallPage .stat-card .stat-info .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
}

#firewallPage .stat-card .stat-info .stat-label {
    font-size: 14px;
    color: #666;
}

/* Firewall Tabs */
.firewall-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 0;
}

.firewall-tabs .tab {
    cursor: pointer;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.firewall-tabs .tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.firewall-tabs .tab.active {
    background: white;
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.firewall-tabs .tab i {
    margin-right: 8px;
}

body.lang-he .firewall-tabs .tab i {
    margin-right: 0;
    margin-left: 8px;
}

/* Firewall Tab Content */
.firewall-tab-content {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.firewall-tab-content.active {
    display: block;
}

/* Manual Ban Form */
.manual-ban-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.manual-ban-form .form-group {
    flex: 1;
    min-width: 150px;
}

.manual-ban-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
}

.manual-ban-form .form-group input,
.manual-ban-form .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Whitelist Display */
.whitelist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.whitelist-ip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.whitelist-ip code {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.whitelist-note {
    font-size: 12px;
    color: #666;
}

/* Log Viewer */
.log-viewer {
    background: #1e293b;
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow: auto;
}

.log-viewer .log-content {
    color: #e2e8f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* Protection Levels */
.protection-levels {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.protection-levels .level-btn {
    flex: 1;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.protection-levels .level-btn:hover {
    border-color: var(--primary);
}

.protection-levels .level-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.protection-levels .level-btn i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.protection-levels .level-btn.low i { color: #16a34a; }
.protection-levels .level-btn.medium i { color: #ca8a04; }
.protection-levels .level-btn.high i { color: #dc2626; }

.protection-levels .level-btn span {
    font-weight: 600;
    display: block;
}

.protection-levels .level-btn small {
    color: #666;
    font-size: 12px;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.settings-grid .form-group {
    margin-bottom: 0;
}

.settings-grid .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.settings-grid .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* Service Controls */
.service-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.service-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--gray-light);
    padding: 15px 20px;
    border-radius: 8px;
    flex: 1;
    min-width: 250px;
}

.service-control .service-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.service-control .service-info {
    flex: 1;
}

.service-control .service-info strong {
    display: block;
    margin-bottom: 2px;
}

.service-control .service-info small {
    color: #666;
}

.service-control .service-actions {
    display: flex;
    gap: 5px;
}

/* Firewall Tables */
#firewallPage table {
    width: 100%;
    border-collapse: collapse;
}

#firewallPage table th,
#firewallPage table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

body.lang-he #firewallPage table th,
body.lang-he #firewallPage table td {
    text-align: right;
}

#firewallPage table th {
    background: var(--gray-light);
    font-weight: 600;
    color: var(--secondary);
}

#firewallPage table tr:hover {
    background: #f9fafb;
}

#firewallPage table code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: monospace;
}

/* Alert Settings */
.alert-settings {
    background: var(--gray-light);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.alert-settings .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.alert-settings .checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Header Actions */
#firewallPage .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

#firewallPage .page-header h2 {
    margin: 0;
}

#firewallPage .header-actions {
    display: flex;
    gap: 10px;
}
