```css
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}
header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    will-change: transform;
}
header.header-hidden {
    transform: translateY(-100%);
}
.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}
.logo {
    height: 70px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s ease;
}
.logo:active {
    transform: scale(0.95);
}
.header-info h1 {
    color: #4CAF50;
    font-size: 26px;
    font-weight: 700;
}
.last-sync {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}
.last-sync strong {
    color: #4CAF50;
}
.subscribers-icon-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
    height: 45px;
    width: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}
.subscribers-icon-btn:hover {
    transform: scale(1.1);
    background: #e3f2fd;
}
.app-links {
    margin-left: 0;
    display: flex;
    gap: 15px;
    align-items: center;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
}
.app-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
    text-decoration: none;
}
.app-link:hover {
    transform: scale(1.05);
}
.app-icon {
    height: 45px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    object-fit: contain;
}
.app-icon.mc {
    height: 45px;
    width: 45px;
}
.app-icon.yd {
    height: 45px;
    width: 45px;
}
.app-icon.rs {
    height: 45px;
    width: auto;
    max-width: 180px;
}
.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.header-actions button,
.header-actions .btn-logout {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.header-actions button {
    background: #2196F3;
    color: white;
}
.header-actions button:hover {
    background: #1976D2;
    transform: translateY(-1px);
}
.header-actions button[style*="F44336"] {
    background: #F44336 !important;
}
.header-actions button[style*="F44336"]:hover {
    background: #D32F2F !important;
}
.btn-logout {
    background: #F44336;
    color: white;
}
.btn-logout:hover {
    background: #D32F2F;
    transform: translateY(-1px);
}
#adminButtons {
    display: none;
}
#adminButtons[data-visible="true"] {
    display: flex !important;
}
main {
    max-width: 1600px;
    margin: 30px auto;
    padding: 0 30px;
}
.filters {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.filters input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}
.filters input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}
.filters button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.filters button:nth-child(5) {
    background: #4CAF50;
    color: white;
}
.filters button:nth-child(6) {
    background: #FF9800;
    color: white;
}
.filters button:nth-child(7) {
    background: #2196F3;
    color: white;
}
.filters button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-height: 70vh;
    position: relative;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}
thead {
    background: #e3f2fd;
    color: #1565c0;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 2px solid #bbdefb;
}
td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
tr.even {
    background: #fafafa;
}
tr.odd {
    background: #fff;
}
tbody tr:hover {
    background: #bbdefb;
}
#readingsTable th,
#readingsTable td {
    font-family: 'Source Code Pro', 'Courier New', monospace;
}
.col-abonent {
    font-weight: 600;
    color: #1565c0;
    min-width: 220px;
    cursor: default;
}
.col-date {
    color: #666;
    min-width: 150px;
    font-size: 14px;
}
.col-t1 {
    color: #e65100;
    font-weight: 500;
    min-width: 120px;
    font-size: 16px;
}
.col-t2 {
    color: #283593;
    font-weight: 500;
    min-width: 120px;
    font-size: 16px;
}
.col-total {
    color: #1b5e20;
    font-weight: 500;
    font-size: 16px;
    min-width: 120px;
}
.col-serial {
    color: #1565c0;
    font-weight: bold;
    min-width: 170px;
    font-size: 14px;
    white-space: nowrap;
}
.abonent-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}
.abonent-name {
    font-weight: 600;
    color: #1565c0;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.abonent-name:hover {
    text-decoration: underline;
}
.abonent-sep {
    color: #b0bec5;
    font-weight: 400;
    margin-right: 6px;
}
.abonent-net {
    color: #2e7d32;
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
    text-align: right;
}
.net-value {
    display: inline-block;
    width: 3ch;
    text-align: left;
}
.serial-edit,
.serial-delete {
    cursor: pointer;
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.15s ease;
}
.serial-edit:hover,
.serial-delete:hover {
    transform: scale(1.2);
}
.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px !important;
}
.table-footer {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
#recordCount {
    color: #666;
    font-weight: 600;
}
.pagination-controls {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.pagination-btn:hover {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}
.pagination-btn.active {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-content {
    background: #fff;
    margin: 4vh auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: none;
    overflow-y: visible;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.modal-large {
    max-width: 1000px !important;
    width: 90% !important;
    margin: 4vh auto !important;
    padding: 25px !important;
    max-height: 92vh;
    overflow-y: auto;
}
.modal-subscribers {
    max-width: 1000px !important;
    width: 90% !important;
    margin: 4vh auto !important;
    padding: 25px !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
}
.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}
.close:hover {
    color: #333;
}
.modal-content h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 22px;
}
.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}
.modal-content input:focus {
    outline: none;
    border-color: #4CAF50;
}
.modal-content button {
    width: 100%;
    padding: 14px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 15px;
}
.modal-content button:hover {
    background: #45a049;
}
#clearModal .modal-content h2 {
    color: #F44336 !important;
}
#clearModal .modal-content button {
    background: #F44336 !important;
}
#clearModal .modal-content button:hover {
    background: #D32F2F !important;
}
#adminLoginModal .modal-content h2 {
    color: #2196F3 !important;
}
#adminLoginModal .modal-content button {
    background: #2196F3 !important;
}
#adminLoginModal .modal-content button:hover {
    background: #1976D2 !important;
}
#subscriberPasswordCreateModal .modal-content h2,
#subscriberPasswordLoginModal .modal-content h2 {
    color: #2196F3 !important;
}
#subscriberPasswordCreateModal .modal-content button,
#subscriberPasswordLoginModal .modal-content button {
    background: #2196F3 !important;
}
#subscriberPasswordCreateModal .modal-content button:hover,
#subscriberPasswordLoginModal .modal-content button:hover {
    background: #1976D2 !important;
}
#exportModal .modal-content {
    padding: 15px !important;
    max-width: 500px !important;
    margin: 4vh auto !important;
}
#exportModal h2 {
    font-size: 18px !important;
    margin-bottom: 12px !important;
}
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 10px 0;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
}
.export-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    font-size: 12px;
}
.export-options label:hover {
    background: #eee;
}
.export-options input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}
.export-info {
    display: none !important;
}
.export-date-range {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}
.export-date-range input {
    flex: 1;
    padding: 7px;
    font-size: 12px;
}
#exportModal button {
    padding: 10px !important;
    font-size: 14px !important;
    margin-top: 8px !important;
}
.history-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.history-info .info-row {
    margin: 0;
    color: #1565c0;
    font-size: 13px;
}
.history-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
    max-height: 400px;
    overflow-y: auto;
}
#historyTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 600px;
}
#historyTable thead {
    background: #2196F3;
    color: white;
    position: sticky;
    top: 0;
    z-index: 5;
}
#historyTable th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.2);
}
#historyTable th:last-child {
    border-right: none;
}
#historyTable td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
#historyTable th,
#historyTable td {
    font-family: 'Source Code Pro', 'Courier New', monospace;
}
#historyTable th:nth-child(1),
#historyTable td:nth-child(1) {
    width: 34%;
}
#historyTable th:nth-child(2),
#historyTable td:nth-child(2) {
    width: 22%;
}
#historyTable th:nth-child(3),
#historyTable td:nth-child(3) {
    width: 22%;
}
#historyTable th:nth-child(4),
#historyTable td:nth-child(4) {
    width: 22%;
}
#historyTable td:nth-child(1) {
    color: #666;
}
#historyTable td:nth-child(2) {
    color: #e65100;
    font-weight: 500;
}
#historyTable td:nth-child(3) {
    color: #283593;
    font-weight: 500;
}
#historyTable td:nth-child(4) {
    color: #1b5e20;
    font-weight: 500;
}
.history-delta {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    font-weight: 400;
    color: #333;
    white-space: nowrap;
    letter-spacing: -0.2px;
}
.history-delta-arrow {
    font-weight: 300;
    font-size: 11px;
}
.history-delta-arrow.up {
    color: #43a047;
}
#historyTable tr.even {
    background: #fafafa;
}
#historyTable tr.odd {
    background: #fff;
}
#historyTable tbody tr:hover {
    background: #e3f2fd;
}
.history-note {
    text-align: center;
    color: #666;
    font-size: 13px;
    font-style: italic;
    margin-top: 10px;
}
.subscriber-add-form {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #4CAF50;
}
.subscriber-add-form .form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.subscriber-add-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}
.subscriber-add-form input::placeholder {
    color: #888;
    font-size: 12px;
}
.subscriber-add-form button {
    min-height: 42px;
}
.subscribers-list-container {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}
.subscribers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.subscribers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px;
}
.subscriber-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.subscriber-card:hover {
    background: #e3f2fd;
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.card-serial {
    font-size: 11px;
    font-weight: 600;
    color: #1565c0;
    white-space: nowrap;
}
.card-net {
    font-size: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
}
.card-count {
    font-size: 10px;
    background: #e3f2fd;
    color: #1976D2;
    padding: 2px 6px;
    border-radius: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}
.card-count-link {
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}
.card-count-link:hover {
    background: #bbdefb;
    transform: scale(1.08);
}
.card-address-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.card-address {
    font-size: 11px;
    color: #333;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
}
.card-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}
.card-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}
.card-actions .btn-edit {
    background: #2196F3;
    color: white;
}
.card-actions .btn-edit:hover {
    background: #1976D2;
}
.card-actions .btn-delete {
    background: #F44336;
    color: white;
}
.card-actions .btn-delete:hover {
    background: #D32F2F;
}
.card-actions .btn-reset-password {
    background: #FF9800;
    color: white;
}
.card-actions .btn-reset-password:hover {
    background: #F57C00;
}
.grid-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 13px;
}
.grid-loading {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 13px;
}
.subscribers-grid::-webkit-scrollbar {
    width: 6px;
}
.subscribers-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.subscribers-grid::-webkit-scrollbar-thumb {
    background: #90caf9;
    border-radius: 3px;
}
.subscribers-grid::-webkit-scrollbar-thumb:hover {
    background: #64b5f6;
}
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    background: #90caf9;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64b5f6;
}
#siteWrapper {
    min-height: 100vh;
    transition: filter 0.3s ease;
}
#siteWrapper.blurred {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}
#pinOverlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 242, 245, 0.6);
}
#pinOverlay.hidden {
    display: none;
}
.pin-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    text-align: center;
    max-width: 92%;
}
.pin-logo {
    display: block;
    margin: 0 auto 10px;
    height: 56px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}
.pin-title {
    font-size: 18px;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 6px;
}
.pin-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 18px;
    line-height: 1.5;
}
.pin-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pin-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-family: 'Source Code Pro', 'Courier New', monospace;
    border: 2px solid #bbdefb;
    border-radius: 8px;
    outline: none;
    background: #fafafa;
    padding: 0;
}
.pin-inputs input:focus {
    border-color: #2196F3;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}
.pin-sep {
    font-size: 24px;
    color: #90a4ae;
    font-weight: 700;
}
.pin-error {
    margin-top: 6px;
    font-size: 13px;
    color: #c62828;
    min-height: 18px;
}
.pin-box.shake {
    animation: pinShake 0.4s ease;
}
@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}
.pin-label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    color: #666;
    text-align: center;
    font-weight: 600;
}
.pin-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e0e0e0;
}
.pin-section:first-of-type {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}
.pin-app-links {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid #e0e0e0;
}
.pin-app-links .app-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
    text-decoration: none;
}
.pin-app-links .app-link:hover {
    transform: scale(1.05);
}
.pin-app-links .app-icon {
    height: 40px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    object-fit: contain;
}
.pin-app-links .app-icon.mc {
    height: 40px;
    width: 40px;
}
.pin-app-links .app-icon.rs {
    height: 40px;
    max-width: 160px;
}
.modal-content .pin-inputs {
    margin: 10px 0;
}
.modal-content .pin-inputs input {
    width: 46px;
    height: 54px;
    font-size: 22px;
}
.modal-content .pin-error {
    margin-top: 10px;
}
#passwordModal .modal-content,
#masterPinModal .modal-content {
    padding: 20px 30px;
}
#passwordModal .pin-section,
#masterPinModal .pin-section {
    margin-top: 12px;
    padding-top: 10px;
}
#passwordModal .pin-label,
#masterPinModal .pin-label {
    margin: 8px 0 4px;
}
#passwordModal .modal-content .pin-inputs,
#masterPinModal .modal-content .pin-inputs {
    margin: 6px 0;
}
#passwordModal .modal-content button,
#masterPinModal .modal-content button {
    margin-top: 10px;
    padding: 12px;
}
#passwordModal .modal-content h2,
#masterPinModal .modal-content h2 {
    margin-bottom: 12px;
}
.remember-password {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}
.remember-password input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.remember-password-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    justify-content: flex-start;
    white-space: nowrap;
}
.remember-password-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}
.password-lock-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
    color: #856404;
    font-size: 13px;
    text-align: center;
}
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f0f2f5;
}
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}
.login-logo {
    height: 80px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.login-box h1 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 24px;
}
.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}
.login-box button {
    width: 100%;
    padding: 14px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 15px;
}
.login-box button:hover {
    background: #45a049;
}
.error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}
.names-list {
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}
.name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}
.name-item:hover {
    background: #f5f5f5;
}
.name-item:last-child {
    border-bottom: none;
}
.name-actions {
    display: flex;
    gap: 5px;
}
.name-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.btn-edit {
    background: #2196F3;
    color: white;
}
.btn-edit:hover {
    background: #1976D2;
}
.btn-delete {
    background: #F44336;
    color: white;
}
.btn-delete:hover {
    background: #D32F2F;
}
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    .header-actions {
        margin-left: 0;
        justify-content: center;
    }
    .subscribers-icon-btn {
        margin-left: 0;
        align-self: center;
        margin-top: 10px;
        height: 35px;
        width: 35px;
        font-size: 28px;
    }
    .app-links {
        margin-left: 0;
        justify-content: center;
        border-left: none;
        padding-left: 0;
        border-top: 2px solid #e0e0e0;
        padding-top: 15px;
        margin-top: 15px;
        width: 100%;
    }
    .app-icon {
        height: 35px;
    }
    .app-icon.mc,
    .app-icon.yd {
        width: 35px;
        height: 35px;
    }
    .app-icon.rs {
        max-width: 140px;
        height: 35px;
    }
    .logo {
        height: 50px;
    }
    .header-info h1 {
        font-size: 20px;
    }
    .last-sync {
        font-size: 12px;
    }
    .filters {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }
    .filters input {
        width: 100%;
        min-width: 100%;
        padding: 8px 12px;
        font-size: 13px;
    }
    .filters button {
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
    }
    .export-options {
        grid-template-columns: repeat(1, 1fr);
    }
    .history-info {
        grid-template-columns: 1fr;
    }
    .modal-large {
        max-width: 95% !important;
    }
}
@media (max-width: 768px) {
    .app-links {
        flex-direction: row;
        gap: 10px;
        padding: 10px;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        margin-left: 0;
        margin-top: 15px;
        justify-content: center;
    }
    .app-icon {
        height: 35px !important;
        width: auto !important;
        max-width: 120px !important;
    }
    .app-icon.mc,
    .app-icon.yd {
        width: 35px !important;
        height: 35px !important;
    }
    .app-icon.rs {
        max-width: 140px !important;
        height: 35px !important;
    }
    .filters {
        padding: 15px;
        gap: 10px;
    }
    .filters input {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 100%;
    }
    .filters button {
        padding: 10px 15px;
        font-size: 13px;
        width: 100%;
    }
    .header-info h1 {
        font-size: 20px;
    }
    .last-sync {
        font-size: 12px;
    }
    .logo {
        height: 50px;
    }
    main {
        padding: 0 15px;
    }
    .table-container {
        overflow-x: scroll;
        max-height: 60vh;
    }
    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }
    .modal-large {
        max-width: 100% !important;
        width: 98% !important;
        margin: 3vh auto;
    }
    .modal-subscribers {
        max-width: 100% !important;
        width: 95% !important;
        margin: 3vh auto !important;
    }
    .subscriber-add-form .form-row {
        flex-direction: column;
    }
    .subscriber-add-form input,
    .subscriber-add-form button {
        width: 100%;
    }
    .subscribers-header {
        flex-direction: column;
        gap: 10px;
    }
    #searchSubscriber {
        width: 100% !important;
    }
    .subscribers-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    #exportModal .modal-content {
        padding: 15px !important;
        margin: 3vh auto !important;
        max-width: 95% !important;
    }
    #exportModal h2 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    .export-options {
        gap: 6px !important;
        padding: 10px !important;
        margin: 12px 0 !important;
    }
    .export-options label {
        font-size: 12px !important;
        padding: 4px !important;
        gap: 6px !important;
    }
    .export-options input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
    }
    .export-date-range {
        flex-direction: column !important;
        gap: 8px !important;
        margin: 12px 0 !important;
    }
    .export-date-range input {
        padding: 8px !important;
        font-size: 12px !important;
    }
    #exportModal button {
        padding: 10px !important;
        font-size: 14px !important;
        margin-top: 10px !important;
    }
    .close {
        font-size: 24px !important;
        right: 15px !important;
        top: 10px !important;
    }
    .app-icon {
        width: 28px;
        height: 28px;
    }
    .table-footer {
        flex-direction: column;
        text-align: center;
    }
    .pagination-controls {
        justify-content: center;
        width: 100%;
    }
    .col-abonent {
        min-width: 150px !important;
        font-size: 12px !important;
    }
    .abonent-cell {
        max-width: 100% !important;
    }
    .col-date {
        min-width: 75px !important;
        font-size: 11px !important;
    }
    .col-t1 {
        min-width: 70px !important;
        font-size: 12px !important;
    }
    .col-t2 {
        min-width: 70px !important;
        font-size: 12px !important;
    }
    .col-total {
        min-width: 75px !important;
        font-size: 13px !important;
    }
    .col-serial {
        min-width: 95px !important;
        font-size: 10px !important;
        letter-spacing: -0.3px !important;
    }
    .abonent-net {
        font-size: 10px !important;
    }
    .serial-edit,
    .serial-delete {
        margin-left: 3px !important;
    }
    table {
        min-width: 560px !important;
    }
    th {
        font-size: 10px !important;
        padding: 8px 4px !important;
    }
}
@media (max-width: 480px) {
    .app-links {
        gap: 8px;
        padding: 8px;
    }
    .app-icon {
        height: 30px !important;
        max-width: 100px !important;
    }
    .app-icon.mc,
    .app-icon.yd {
        width: 30px !important;
        height: 30px !important;
    }
    .app-icon.rs {
        max-width: 120px !important;
        height: 30px !important;
    }
    .filters {
        padding: 12px;
        gap: 8px;
    }
    .filters input {
        padding: 7px 10px;
        font-size: 12px;
    }
    .filters button {
        padding: 9px 12px;
        font-size: 12px;
    }
    .header-info h1 {
        font-size: 18px;
    }
    .last-sync {
        font-size: 11px;
    }
    .logo {
        height: 45px;
    }
    .subscribers-icon-btn {
        height: 30px;
        width: 30px;
        font-size: 24px;
    }
    #exportModal .modal-content {
        padding: 12px !important;
        margin: 2vh auto !important;
        width: 98% !important;
    }
    #exportModal h2 {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
    .export-options {
        gap: 4px !important;
        padding: 8px !important;
        margin: 10px !important;
    }
    .export-options label {
        font-size: 11px !important;
        padding: 3px !important;
        gap: 5px !important;
    }
    .export-options input[type="checkbox"] {
        width: 13px !important;
        height: 13px !important;
    }
    .export-date-range input {
        padding: 7px !important;
        font-size: 11px !important;
    }
    #exportModal button {
        padding: 9px !important;
        font-size: 13px !important;
    }
    .close {
        font-size: 22px !important;
    }
    .app-icon {
        width: 24px;
        height: 24px;
    }
    .col-abonent {
        min-width: 135px !important;
        font-size: 11px !important;
    }
    .abonent-cell {
        max-width: 100% !important;
        gap: 4px !important;
    }
    .col-date {
        min-width: 65px !important;
        font-size: 10px !important;
    }
    .col-t1, .col-t2 {
        min-width: 55px !important;
        font-size: 10px !important;
    }
    .col-total {
        min-width: 60px !important;
        font-size: 11px !important;
    }
    .col-serial {
        min-width: 80px !important;
        font-size: 9px !important;
        letter-spacing: -0.5px !important;
    }
    .abonent-net {
        font-size: 9px !important;
    }
    .abonent-sep {
        margin-right: 3px !important;
    }
    th, td {
        padding: 5px 3px !important;
        font-size: 10px !important;
    }
    th {
        font-size: 9px !important;
        padding: 6px 3px !important;
    }
    table {
        min-width: 470px !important;
    }
    #historyModal .modal-content {
        margin: 4vh auto !important;
        width: 92% !important;
        max-width: 92% !important;
        height: 92vh;
        max-height: 92vh !important;
        padding: 12px !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 30px rgba(0,0,0,0.35) !important;
        overflow-y: auto !important;
    }
    #historyModal h2 {
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    #historyModal .close {
        font-size: 32px !important;
        right: 10px !important;
        top: 6px !important;
        padding: 4px 10px;
        color: #666;
    }
    #historyModal .history-info {
        padding: 10px !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
        border-left-width: 3px !important;
    }
    #historyModal .history-info .info-row {
        font-size: 11px !important;
    }
    #historyModal .history-table-container {
        overflow-x: hidden !important;
        max-height: none !important;
        overflow-y: visible !important;
        margin-bottom: 10px !important;
    }
    #historyTable {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: fixed !important;
    }
    #historyTable th {
        font-size: 10px !important;
        padding: 8px 3px !important;
        white-space: nowrap !important;
    }
    #historyTable td {
        font-size: 11px !important;
        padding: 7px 3px !important;
    }
    #historyTable th:nth-child(1),
    #historyTable td:nth-child(1) {
        width: 34%;
    }
    #historyTable th:nth-child(2),
    #historyTable td:nth-child(2) {
        width: 22%;
    }
    #historyTable th:nth-child(3),
    #historyTable td:nth-child(3) {
        width: 22%;
    }
    #historyTable th:nth-child(4),
    #historyTable td:nth-child(4) {
        width: 22%;
    }
    #historyModal .history-note {
        font-size: 11px !important;
        margin-top: 8px !important;
    }
    .history-delta {
        display: block;
        margin-left: 0;
        font-size: 9px;
    }
    .history-delta-arrow {
        font-size: 9px;
    }
    .pin-box {
        padding: 24px 18px;
    }
    .pin-logo {
        height: 44px;
        margin-bottom: 8px;
    }
    .pin-inputs input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
    .modal-content .pin-inputs input {
        width: 40px;
        height: 48px;
        font-size: 19px;
    }
    .pin-title {
        font-size: 16px;
    }
    .pin-hint {
        font-size: 11px;
    }
    .pin-app-links {
        gap: 10px;
        margin-top: 8px;
        padding-top: 10px;
    }
    .pin-app-links .app-icon {
        height: 32px;
    }
    .pin-app-links .app-icon.mc {
        width: 32px;
    }
    .pin-app-links .app-icon.rs {
        max-width: 130px;
    }
    #passwordModal .modal-content,
    #masterPinModal .modal-content {
        padding: 16px 14px;
        margin: 3vh auto;
    }
}

@media (min-width: 1200px) {
    .filters {
        flex-wrap: nowrap;
        align-items: center;
    }
    .filters input {
        flex: 1 1 0;
        min-width: 0;
    }
    .filters input[type="date"] {
        flex: 0 0 170px;
    }
    .filters button {
        flex: 0 0 auto;
    }
}