@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --navy: #172554;
    --navy-light: #1e3a5f;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --surface: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

* {
    font-family: 'DM Sans', system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.font-heading {
    font-family: 'Outfit', system-ui, sans-serif;
}

body {
    background-color: var(--surface);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar-link {
    transition: all 0.15s ease;
}

.page-shell {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
}

@media (max-width: 1023px) {
    .content-area {
        padding: 1rem;
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.03);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: white;
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
    border: 1px solid var(--border);
    cursor: pointer;
}
.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
    border: none;
    cursor: pointer;
}
.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-icon {
    padding: 0.375rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
    background: transparent;
}
.btn-icon:hover {
    background-color: #f1f5f9;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: auto;
}
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table thead th {
    background: #f8fafc;
    padding: 0.625rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.4);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-panel {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 639px) {
    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }
    .modal-panel {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        max-width: 100% !important;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.photo-upload-zone {
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.photo-upload-zone:hover {
    border-color: var(--accent);
    background: rgb(37 99 235 / 0.02);
}
.photo-upload-zone.dragover {
    border-color: var(--accent);
    background: rgb(37 99 235 / 0.05);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.login-bg {
    background: #050a18;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

@media (max-width: 639px) {
    .data-table thead {
        display: none;
    }
    .data-table tbody tr {
        display: block;
        padding: 0.5rem 0.625rem;
        margin-bottom: 0.375rem;
        border: 1px solid var(--border);
        border-radius: 0.5rem;
        background: white;
        position: relative;
    }
    .data-table tbody tr:hover {
        background: white;
    }
    .data-table tbody td {
        display: inline;
        padding: 0;
        border-bottom: none;
        font-size: 0.75rem;
    }
    .data-table tbody td:not(.mobile-date):not(.mobile-actions):not(.mobile-comments):not(.mobile-photos):not(.mobile-type):not(.mobile-vk):not(.mobile-street):not(.mobile-company-brand):not(.mobile-period):not(.mobile-user)::after {
        content: ' · ';
        color: #cbd5e1;
    }
    .data-table tbody td:not(.mobile-date):not(.mobile-actions):not(.mobile-comments):not(.mobile-photos):not(.mobile-type):not(.mobile-vk):not(.mobile-street):not(.mobile-company-brand):not(.mobile-period):not(.mobile-user):last-of-type::after,
    .data-table tbody td:empty::after {
        content: '';
    }
    .data-table tbody td.mobile-type {
        display: block;
        margin-bottom: 0.125rem;
    }
    .data-table tbody td.mobile-type::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-user {
        display: block;
        font-size: 0.625rem;
        color: #6b7280;
        font-weight: 500;
        margin-bottom: 0.125rem;
    }
    .data-table tbody td.mobile-user::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-user:empty {
        display: none;
    }
    .data-table tbody td.mobile-vk {
        display: block;
        font-weight: 700;
        font-size: 0.6875rem;
        color: var(--text);
    }
    .data-table tbody td.mobile-vk::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-street {
        display: block;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.75rem;
        color: var(--text);
        margin-bottom: 0.25rem;
    }
    .data-table tbody td.mobile-street::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-company-brand {
        display: block;
        font-weight: 500;
        font-size: 0.8125rem;
        color: var(--text);
    }
    .data-table tbody td.mobile-company-brand::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-period {
        display: block;
        font-size: 0.6875rem;
        color: var(--text-muted);
    }
    .data-table tbody td.mobile-period::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-date {
        display: none;
    }
    .data-table tbody td.mobile-date::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-actions {
        display: flex !important;
        align-items: center;
        padding-top: 0.375rem;
        margin-top: 0.25rem;
        border-top: 1px solid #f1f5f9;
    }
    .data-table tbody td.mobile-actions::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-comments {
        display: block;
        color: var(--text-muted);
        font-size: 0.6875rem;
        margin-top: 0.125rem;
    }
    .data-table tbody td.mobile-comments::after {
        content: '' !important;
    }
    .data-table tbody td.mobile-comments:empty {
        display: none;
    }
    .data-table tbody td.mobile-photos {
        display: block;
        margin-top: 0.25rem;
    }
    .data-table tbody td.mobile-photos::after {
        content: '' !important;
    }
}

@media (max-width: 639px) {
    .mobile-no-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}

.entry-row {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}
