* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.5;
    min-height: 100vh;
}

.app { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; min-height: 100vh; }

.header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.header-logo { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.header-user { font-size: 14px; opacity: .9; }
.header-burger {
    display: none; background: none; border: none; cursor: pointer;
    width: 28px; height: 20px; position: relative;
}
.header-burger span { display: block; height: 3px; background: #fff; border-radius: 2px; margin: 4px 0; }

.menu, .cabinet-menu {
    display: flex; gap: 4px; padding: 12px 0; flex-wrap: wrap;
}
.menu-item {
    padding: 8px 18px; border-radius: 8px; cursor: pointer;
    font-size: 14px; font-weight: 500; color: #5f6368;
    transition: all .2s; user-select: none;
}
.menu-item:hover { background: #e8f0fe; color: #1a73e8; }
.menu-item-active { background: #1a73e8; color: #fff; }
.menu-item-active:hover { background: #1557b0; color: #fff; }
.menu-item-exit { margin-left: auto; color: #d93025; }
.menu-item-exit:hover { background: #fce8e6; }
.menu-item-admin { color: #7b1fa2; }

.main { flex: 1; padding: 16px 0; }

.section { display: none; animation: fadeIn .3s; }
.section-active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.form-card {
    background: #fff; border-radius: 12px; padding: 24px; max-width: 480px;
    margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.form-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: #1a73e8; }
.form-error { color: #d93025; font-size: 13px; margin-bottom: 8px; display: none; }
.input {
    width: 100%; padding: 10px 14px; margin-bottom: 12px; border: 1px solid #dadce0;
    border-radius: 8px; font-size: 14px; transition: border .2s; outline: none;
}
.input:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.15); }

.btn {
    padding: 10px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all .2s; display: inline-block;
}
.btn-primary { background: #1a73e8; color: #fff; width: 100%; }
.btn-primary:hover { background: #1557b0; }
.btn-back { background: #f1f3f4; color: #3c4043; margin-bottom: 12px; }
.btn-back:hover { background: #e8eaed; }

.table-wrap { overflow-x: auto; margin-bottom: 16px; }
.table {
    width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.1); font-size: 13px;
}
.table th {
    background: #f8f9fa; padding: 10px 12px; text-align: left; font-weight: 600;
    color: #3c4043; border-bottom: 2px solid #e8eaed; white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #f1f3f4; }
.table tbody tr { cursor: pointer; transition: background .15s; }
.table tbody tr:hover { background: #f1f3f4; }

.state-ok { color: #188038; font-weight: 600; }
.state-error { color: #d93025; font-weight: 600; }
.state-warning { color: #e37400; font-weight: 600; }
.state-poweron { color: #7b1fa2; font-weight: 600; }
.state-incass { color: #1a73e8; font-weight: 600; }

.water-bar { display: flex; gap: 3px; }
.water-dot {
    width: 16px; height: 16px; border-radius: 50%; border: 2px solid #dadce0;
}
.water-dot-yes { background: #188038; border-color: #188038; }
.water-dot-no { background: #d93025; border-color: #d93025; }

.vending-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.vending-header h2 { font-size: 20px; }
.vending-totals { font-size: 13px; color: #5f6368; }

.history { margin-top: 16px; }
.history h3 { margin-bottom: 12px; }

.modal-history {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.4); z-index: 400; display: none;
  align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto;
}
.modal-history-content {
  background: #fff; border-radius: 12px; padding: 24px; max-width: 1200px;
  width: 100%; margin-top: 20px; box-shadow: 0 4px 24px rgba(0,0,0,.2);
  animation: fadeIn .2s;
}
.modal-history-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.modal-history-header h3 { font-size: 18px; color: #1a73e8; }
.modal-history-close {
  width: 32px; height: 32px; border: none; background: #f1f3f4; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #5f6368; transition: background .2s;
}
.modal-history-close:hover { background: #e8eaed; }

.footer {
    text-align: center; padding: 16px; color: #5f6368; font-size: 13px;
    border-top: 1px solid #e8eaed; margin-top: auto;
}

.overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.3); z-index: 200;
}
.burger-menu {
    display: none; position: fixed; top: 0; left: 0; width: 280px; height: 100%;
    background: #fff; z-index: 300; box-shadow: 2px 0 12px rgba(0,0,0,.15);
    padding: 16px; overflow-y: auto;
}
.burger-menu-close { font-size: 28px; cursor: pointer; color: #5f6368; text-align: right; }

.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.3); z-index: 400; display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: #fff; border-radius: 12px; padding: 32px; max-width: 400px;
    width: 90%; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.modal-text { margin-bottom: 16px; font-size: 16px; }

.report-type { margin-bottom: 12px; }
.report-type label { margin-right: 16px; font-size: 14px; cursor: pointer; }

.phones-list { margin-bottom: 16px; }
.phone-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px; border-bottom: 1px solid #f1f3f4; font-size: 14px;
}
.phone-item .phone-actions button {
    padding: 4px 12px; border: 1px solid #dadce0; border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 12px; margin-left: 4px;
}
.phone-item .phone-actions button:hover { background: #f1f3f4; }

#tehnikBlock .tehnik-row { margin-bottom: 12px; padding: 12px; background: #f8f9fa; border-radius: 8px; }
#tehnikBlock .tehnik-row input { margin-bottom: 6px; }

@media (max-width: 768px) {
    .header-burger { display: block; }
    .menu, .cabinet-menu { display: none; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 6px 8px; }
    .form-card { padding: 16px; }
}
