/* Clean Minimalist Design - Google-inspired */

:root {
    /* Glassmorphism Colors */
    --bg-gradient-start: #434343;
    --bg-gradient-mid: #2d2d2d;
    --bg-gradient-end: #1a1a1a;
    --bg-radial-1: rgba(80, 80, 80, 0.3);
    --bg-radial-2: rgba(60, 60, 60, 0.3);
    --bg-radial-3: rgba(90, 90, 90, 0.3);
    
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-hover: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-border-hover: rgba(255, 255, 255, 0.3);
    
    --text-primary: white;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-light: rgba(255, 255, 255, 0.6);
    
    --panel-bg: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-bg-focus: rgba(255, 255, 255, 0.12);
    
    /* Legacy */
    --white: rgba(255, 255, 255, 0.1);
    --light-gray: rgba(255, 255, 255, 0.05);
    --gray: rgba(255, 255, 255, 0.15);
    --dark-gray: rgba(255, 255, 255, 0.5);
    --accent: #3A7AFE;
    --accent-hover: #2868E8;
    --border: rgba(255, 255, 255, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    
    /* Border Radius */
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, var(--bg-radial-1), transparent 50%),
        radial-gradient(circle at 80% 80%, var(--bg-radial-2), transparent 50%),
        radial-gradient(circle at 40% 20%, var(--bg-radial-3), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

/* Header */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
}

/* Container */
.container {
    display: flex;
    height: calc(100vh - 57px);
    width: 100vw;
    overflow: hidden;
}

/* Workspace */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--white);
    overflow: hidden;
}

.left-workspace {
    border-right: 1px solid var(--border);
}

/* Workspace Header */
.workspace-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.workspace-header h2 {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-primary);
}

/* Workspace Content */
.workspace-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: transparent;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 16px;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 24px;
    margin-bottom: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--glass-border-hover);
}

.card h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Одинаковая высота для первых карточек синхронизации и баланса */
.workspace-content > .card:first-child {
    min-height: 180px;
}

/* Statistics Card */
.stat-card {
    background: var(--white);
    display: flex;
    justify-content: space-around;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
}

.stat-value.error {
    color: var(--dark-gray);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--dark-gray);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(58, 122, 254, 0.1);
}

.info-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Balance Card */
.balance-card {
    background: var(--white);
    color: var(--text-primary);
    text-align: center;
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    margin: 24px;
    padding: 32px 24px;
    box-shadow: var(--shadow-sm);
}

.balance-card h3 {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.balance-amount {
    font-size: 48px;
    font-weight: 300;
    color: var(--accent);
    letter-spacing: -1px;
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: inline-block;
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(229, 231, 235, 0.8));
    color: #1f2937;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(243, 244, 246, 0.9));
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28ca42, #1aab29);
    color: white;
    box-shadow: 0 4px 16px rgba(40, 202, 66, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #1aab29, #28ca42);
    box-shadow: 0 6px 24px rgba(40, 202, 66, 0.5);
}

.btn-warning {
    background: linear-gradient(135deg, #ffbd2e, #dfa123);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 189, 46, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #dfa123, #ffbd2e);
    box-shadow: 0 6px 24px rgba(255, 189, 46, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #ff5f57, #e04640);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 95, 87, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e04640, #ff5f57);
    box-shadow: 0 6px 24px rgba(255, 95, 87, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: rgba(58, 122, 254, 0.05);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
}

.btn:focus {
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* Убираем border и outline у всех кнопок везде */
button,
.btn,
button:focus,
.btn:focus,
button:active,
.btn:active,
button:hover,
.btn:hover {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Возвращаем border для btn-secondary */
.btn-secondary,
.btn-secondary:focus,
.btn-secondary:active {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.btn-secondary:hover {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Максимально агрессивное удаление границ */
* {
    -webkit-tap-highlight-color: transparent !important;
}

*:focus {
    outline: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Специально для модального окна пароля */
#passwordModal button,
#passwordModal .btn,
#passwordModal button:focus,
#passwordModal .btn:focus,
#passwordModal button:active,
#passwordModal .btn:active,
#passwordModal button:hover,
#passwordModal .btn:hover {
    border: none !important;
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

#passwordModal .btn-primary,
#passwordModal .btn-primary:hover,
#passwordModal .btn-primary:focus,
#passwordModal .btn-primary:active {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
}

#passwordModal .btn-secondary,
#passwordModal .btn-secondary:hover,
#passwordModal .btn-secondary:focus,
#passwordModal .btn-secondary:active {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    outline: none !important;
}

/* Возвращаем нужные box-shadow для стилей кнопок */
.btn-primary {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3) !important;
}

.btn-success {
    box-shadow: 0 4px 16px rgba(40, 202, 66, 0.3) !important;
}

.btn-success:hover {
    box-shadow: 0 6px 24px rgba(40, 202, 66, 0.5) !important;
}

.btn-warning {
    box-shadow: 0 4px 16px rgba(255, 189, 46, 0.3) !important;
}

.btn-warning:hover {
    box-shadow: 0 6px 24px rgba(255, 189, 46, 0.5) !important;
}

.btn-danger {
    box-shadow: 0 4px 16px rgba(255, 95, 87, 0.3) !important;
}

.btn-danger:hover {
    box-shadow: 0 6px 24px rgba(255, 95, 87, 0.5) !important;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    overflow: hidden;
}

thead {
    background: var(--glass-bg-hover);
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tbody tr {
    transition: all 0.3s;
}

tbody tr:hover {
    background: var(--glass-bg-hover);
    transform: translateX(4px);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Класс для скрытия на мобильных (по умолчанию видимо) */
.hide-mobile {
    display: table-cell;
}

/* Синхронизация данных */
.sync-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sync-date-group {
    display: flex;
    flex-direction: column;
}

.sync-button {
    grid-column: 1 / -1;
    padding: 12px 16px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid;
}

.alert-success {
    background: var(--light-gray);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.alert-error {
    background: var(--light-gray);
    color: var(--text-primary);
    border-left-color: var(--dark-gray);
}

.alert-info {
    background: rgba(58, 122, 254, 0.05);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.alert-warning {
    background: var(--light-gray);
    color: var(--text-primary);
    border-left-color: var(--dark-gray);
}

/* Chips/Tags */
.chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: var(--light-gray);
    color: var(--text-secondary);
    margin-right: 8px;
}

.chip-success {
    background: rgba(58, 122, 254, 0.1);
    color: var(--accent);
}

.chip-error {
    background: var(--light-gray);
    color: var(--dark-gray);
}

.chip-warning {
    background: var(--light-gray);
    color: var(--text-secondary);
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Role Selection Screen */
.role-selection-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.role-selection-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--glass-border);
}

.role-selection-container h1 {
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.role-options {
    display: flex;
    gap: 20px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

.role-option {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    min-width: 200px;
}

.role-option:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    background: var(--glass-bg-hover);
}

.role-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.role-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.role-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Admin Interface */
.admin-app {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* History Toggle Button (Hamburger) */
.history-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s ease;
}

.history-toggle-btn:hover {
    opacity: 0.7;
}

.history-toggle-btn:active {
    opacity: 0.5;
}

/* History Close Button */
.history-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
    transition: color 0.2s ease;
}

.history-close-btn:hover {
    color: var(--text-primary);
}

.history-close-btn:active {
    color: var(--accent);
}

.admin-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    font-size: 20px;
    font-weight: 400;
}

.admin-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.admin-history {
    width: 300px;
    background: var(--panel-bg);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    padding: 16px;
    flex-shrink: 0;
}

.admin-history h3 {
    margin-top: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: transparent;
    display: flex;
    justify-content: center;
}

.admin-content-inner {
    width: 100%;
    max-width: 900px;
}

.admin-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.admin-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--glass-border-hover);
}

.admin-card h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

.shift-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.shift-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.shift-item:hover,
.shift-item:hover *,
.admin-history .shift-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateX(4px) !important;
    filter: none !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

.shift-item.closed {
    opacity: 0.6;
}

.shift-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shift-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.shift-status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.shift-status-badge.open {
    background: rgba(58, 122, 254, 0.1);
    color: var(--accent);
}

.shift-status-badge.closed {
    background: var(--light-gray);
    color: var(--text-secondary);
}

.shift-details {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Main App */
.main-app {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.app-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.app-header h1 {
    font-size: 20px;
    font-weight: 400;
}

/* Settings Modal */
.settings-tab {
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    color: var(--accent);
}

.settings-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Переопределение inline-стилей для темной темы */
div[style*="background: #f9f9f9"],
div[style*="background:#f9f9f9"],
div[style*="background: #F9F9F9"] {
    background: var(--card-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

div[style*="background: white"],
div[style*="background: #fff"],
div[style*="background: #FFF"],
div[style*="background:#fff"] {
    background: var(--panel-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

div[style*="border: 1px solid #d0d0d0"] {
    border-color: var(--glass-border) !important;
}

input[style*="border: 1px solid #d0d0d0"] {
    border-color: var(--glass-border) !important;
}

/* НО убираем у кнопок в модальном окне */
#passwordModal button,
#passwordModal .btn,
#passwordModal button[style],
#passwordModal .btn[style] {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
}

label[style*="color: #86868b"],
div[style*="color: #86868b"] {
    color: var(--text-muted) !important;
}

h3[style*="color: #1d1d1f"] {
    color: var(--text-primary) !important;
}

/* Модальные окна */
#settingsModal > div,
#passwordModal > div > div,
#shiftDetailsModal > div > div {
    background: var(--modal-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid var(--glass-border) !important;
}

/* Инпуты в модальных окнах и формах */
input[type="date"],
input[type="text"],
input[type="number"],
input[type="password"] {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

input::placeholder {
    color: var(--text-light) !important;
}

/* Предупреждающие блоки */
div[style*="background: #fff3cd"] {
    background: rgba(255, 193, 7, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left-color: #ffc107 !important;
}

div[style*="color: #856404"] {
    color: rgba(255, 193, 7, 0.9) !important;
}

div[style*="background: #e3f2fd"] {
    background: rgba(33, 150, 243, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

div[style*="color: #1976d2"] {
    color: rgba(33, 150, 243, 0.9) !important;
}

/* Списки и выпадающие меню */
#counterpartySuggestions {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-color: var(--glass-border) !important;
}

/* Textarea и другие элементы форм */
textarea {
    background: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

textarea::placeholder {
    color: var(--text-light) !important;
}

/* Все белые дивы в стиле */
div[style*="background: #ffffff"],
div[style*="background:#ffffff"],
div[style*="background: #FFFFFF"] {
    background: var(--panel-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Модальные окна с белым фоном */
[style*="background: white"],
[style*="background: #fff"],
[style*="background:#fff"] {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Fixes for specific modals */
#withdrawModal div[style*="background"],
#depositModal div[style*="background"],
#advanceModal div[style*="background"] {
    background: var(--modal-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

/* История смен */
.admin-history[style*="background"] {
    background: var(--panel-bg) !important;
    backdrop-filter: blur(10px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(180%) !important;
}

div[style*="background: #f5f5f7"],
div[style*="background:#f5f5f7"] {
    background: var(--panel-bg) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

#shiftsHistoryList {
    background: transparent !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* Touch улучшения */
@media (hover: none) and (pointer: coarse) {
    /* Увеличение области клика для кнопок */
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Убираем hover эффекты на touch устройствах */
    .btn:hover,
    .card:hover,
    .role-option:hover {
        transform: none;
    }
    
    /* Активный статус при касании */
    .btn:active {
        transform: scale(0.98);
    }
    
    .role-option:active {
        transform: scale(0.98);
    }
}

/* Responsive */
@media (max-width: 768px) {
    /* Основной контейнер */
    .container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    body {
        font-size: 13px;
    }
    
    /* Header */
    .header {
        padding: 12px 16px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    /* Workspace */
    .left-workspace {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .workspace {
        height: auto;
        min-height: 50vh;
        overflow: visible;
    }
    
    .workspace-header {
        padding: 16px;
    }
    
    .workspace-header h2 {
        font-size: 16px;
    }
    
    .workspace-content {
        padding: 16px;
        overflow-x: visible;
        overflow-y: visible;
    }
    
    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .card h3 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    /* Убираем минимальную высоту на мобильных */
    .workspace-content > .card:first-child {
        min-height: auto;
    }
    
    /* Tables */
    .table-container {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 11px;
        table-layout: auto;
        width: 100%;
    }
    
    table th,
    table td {
        padding: 6px 4px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Скрываем колонки на мобильных */
    .hide-mobile {
        display: none !important;
    }
    
    /* Синхронизация - вертикальный лейаут на мобильных */
    .sync-controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sync-button {
        grid-column: 1;
        width: 100%;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Main App */
    .main-app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    /* Admin Interface */
    .admin-app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    .admin-header {
        padding: 12px 16px;
    }
    
    .admin-header h1 {
        font-size: 16px;
    }
    
    .admin-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    /* Кнопка-гамбургер видна на мобильных */
    .history-toggle-btn {
        display: flex !important;
    }
    
    /* История смен сверху, скрыта по умолчанию */
    .admin-history {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
        z-index: 1000;
        background: var(--white);
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }
    
    /* Когда история открыта */
    .admin-history.show {
        transform: translateY(0);
    }
    
    /* Кнопка закрытия видна на мобильных */
    .history-close-btn {
        display: block !important;
    }
    
    .admin-content {
        padding: 16px;
        overflow: visible;
    }
    
    .admin-content-inner {
        max-width: 100%;
    }
    
    .admin-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .admin-card h2 {
        font-size: 16px;
    }
    
    /* Role Selection */
    .role-selection-container {
        padding: 24px 16px;
        width: 95%;
    }
    
    .role-selection-container h1 {
        font-size: 20px;
    }
    
    .role-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .role-option {
        min-width: 100%;
        padding: 20px;
    }
    
    .role-icon {
        font-size: 40px;
    }
    
    /* App Header */
    .app-header {
        padding: 12px 16px;
    }
    
    .app-header h1 {
        font-size: 16px;
    }
    
    .app-header .btn {
        padding: 8px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    /* Settings Modal */
    #settingsModal > div {
        width: 95%;
        max-height: 95vh;
        padding: 0;
    }
    
    /* Вкладки настроек - горизонтальный скролл */
    #settingsModal .settings-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Контейнер вкладок с горизонтальным скроллом */
    #settingsModal > div > div:nth-child(2) {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Password Modal */
    #passwordModal > div {
        width: 95%;
        padding: 20px;
    }
    
    /* Stat Card */
    .stat-card {
        flex-direction: column;
        gap: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    /* Balance Display */
    #cashBalance {
        font-size: 32px !important;
    }
    
    /* Forms */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Предотвращает зум на iOS */
    }
    
    /* Flex adjustments for mobile */
    div[style*="display: flex"] {
        flex-wrap: wrap;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    body {
        font-size: 12px;
    }
    
    .role-selection-container h1 {
        font-size: 18px;
    }
    
    .role-option {
        padding: 16px;
    }
    
    .role-icon {
        font-size: 36px;
    }
    
    .role-title {
        font-size: 16px;
    }
    
    .role-description {
        font-size: 12px;
    }
    
    .app-header h1,
    .admin-header h1 {
        font-size: 14px;
    }
    
    .workspace-header h2 {
        font-size: 14px;
    }
    
    .card {
        padding: 12px;
    }
    
    .card h3 {
        font-size: 13px;
    }
    
    table {
        font-size: 11px;
    }
    
    table th,
    table td {
        padding: 6px 4px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #cashBalance {
        font-size: 28px !important;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .admin-card {
        padding: 12px;
    }
    
    .settings-tab {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }

/*   -  BORDER    PASSWORDMODAL */
#passwordModal button,
#passwordModal .btn,
#passwordModal button.btn-secondary,
#passwordModal .btn.btn-secondary,
#passwordModal button.btn-primary,
#passwordModal .btn.btn-primary {
    border: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left: none !important;
}

/*    -  BORDER   PASSWORDMODAL */
#passwordModal *:not(input):not(textarea) {
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
}

#passwordModal button *,
#passwordModal .btn * {
    border: none !important;
}

/*      */
#passwordModal > div {
    background: var(--modal-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

#passwordModal h2,
#passwordModal p {
    color: var(--text-primary) !important;
}
