* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    padding: 20px;
    color: #e8e6e3;
}

.majestic-container {
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(145deg, #12121a, #0e0e14);
    border-radius: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.tablet-panel {
    padding: 20px 24px 0 24px;
    background: linear-gradient(135deg, rgba(20, 18, 25, 0.95), rgba(15, 13, 20, 0.98));
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.header h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #d4af37, #f0d060);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
}

.header p {
    color: #7a7a85;
    font-size: 0.8rem;
    margin-top: 5px;
}

.user-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 60px;
    margin-bottom: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.user-name {
    font-size: 1rem;
    font-weight: 600;
    color: #d4af37;
}

.logout-btn {
    background: #1e1e28;
    padding: 6px 18px;
    border-radius: 40px;
    cursor: pointer;
    border: none;
    color: #b0b0b8;
    font-weight: 500;
    font-size: 0.85rem;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #2a2a35;
    color: #e8e6e3;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 30px 30px 0 0;
    color: #8a8a92;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.tab-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.25s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.storage-header h3 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #d4af37;
}

.storage-stats {
    background: rgba(212, 175, 55, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.storage-stats span {
    color: #d4af37;
    font-weight: bold;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.resource-card {
    background: rgba(18, 16, 22, 0.8);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #262630;
    transition: all 0.2s;
}

.resource-card:hover {
    border-color: #d4af37;
    background: rgba(25, 22, 30, 0.9);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.resource-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #d4af37;
}

.base-badge {
    font-size: 0.6rem;
    background: rgba(76, 175, 80, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    color: #6fbf4c;
}

.resource-user-amount {
    background: rgba(212, 175, 55, 0.1);
    padding: 6px;
    border-radius: 8px;
    margin: 8px 0;
}

.resource-comment {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: #6a6a72;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #262630;
}

.add-to-btn {
    background: #1e1e28;
    border: 1px solid #d4af37;
    padding: 5px 12px;
    border-radius: 20px;
    color: #d4af37;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.2s;
}

.add-to-btn:hover {
    background: #2a2a35;
}

.workshop-status-bar {
    background: rgba(18, 16, 22, 0.8);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 24px;
    border-left: 4px solid #d4af37;
}

.status-main {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 6px;
}

.status-free {
    color: #6fbf4c;
}

.status-busy {
    color: #ff9800;
}

.status-details {
    color: #8a8a92;
    font-size: 0.85rem;
    line-height: 1.6;
}

.queue-info {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #262630;
    font-size: 0.8rem;
    color: #a0a0a8;
}

.craft-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.craft-card {
    background: rgba(18, 16, 22, 0.8);
    border-radius: 20px;
    padding: 18px;
    border: 1px solid #262630;
    transition: 0.2s;
}

.craft-card:hover {
    border-color: #d4af37;
}

.craft-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #d4af37;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #262630;
}

.craft-time {
    text-align: center;
    color: #8a8a92;
    font-size: 0.75rem;
    margin-bottom: 14px;
}

.craft-time span {
    color: #d4af37;
    font-weight: bold;
}

.requirements-compare {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 14px;
}

.req-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.75rem;
    border-bottom: 1px dashed #262630;
}

.req-name {
    color: #b0b0b8;
}

.req-need {
    color: #ffaa66;
}

.req-have {
    color: #6fbf4c;
}

.req-have.insufficient {
    color: #ff6666;
}

.slider-container {
    margin: 14px 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.amount-value {
    color: #d4af37;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: #2a2a35;
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #d4af37;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px #d4af37;
}

.craft-action-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #d4af37, #b8942a);
    border: none;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    color: #1a1a24;
    transition: 0.2s;
    margin-top: 8px;
}

.craft-action-btn:disabled {
    background: #2a2a35;
    cursor: not-allowed;
    color: #6a6a72;
}

.logs-header {
    margin-bottom: 20px;
}

.logs-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #d4af37;
    margin-bottom: 15px;
}

.logs-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.logs-filters input, .logs-filters select {
    background: #1a1a22;
    border: 1px solid #2a2a35;
    padding: 8px 14px;
    border-radius: 12px;
    color: #e8e6e3;
    font-size: 0.85rem;
}

.logs-filters input:focus, .logs-filters select:focus {
    outline: none;
    border-color: #d4af37;
}

.log-table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #262630;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.log-table th {
    background: #15151c;
    padding: 12px 10px;
    text-align: left;
    color: #d4af37;
    font-weight: 500;
    border-bottom: 1px solid #262630;
}

.log-table td {
    padding: 10px;
    border-bottom: 1px solid #1e1e26;
    color: #b0b0b8;
}

.log-table tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #6a6a72;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(145deg, #181820, #101016);
    border-radius: 24px;
    width: 420px;
    max-width: 90%;
    border: 1px solid #d4af37;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #262630;
}

.modal-header h3 {
    color: #d4af37;
    font-size: 1.1rem;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #8a8a92;
}

.modal-close:hover {
    color: #ff6666;
}

.modal-body {
    padding: 20px;
}

.modal-resource-info {
    background: #1a1a22;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
}

.modal-resource-info strong {
    color: #d4af37;
}

.modal-input-group {
    margin-bottom: 16px;
}

.modal-input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: #a0a0a8;
}

.modal-input-group input, .modal-input-group textarea {
    width: 100%;
    background: #1a1a22;
    border: 1px solid #2a2a35;
    padding: 10px 14px;
    border-radius: 12px;
    color: #e8e6e3;
    font-size: 0.9rem;
}

.modal-input-group input:focus, .modal-input-group textarea:focus {
    outline: none;
    border-color: #d4af37;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #262630;
}

.confirm-btn {
    flex: 1;
    background: linear-gradient(135deg, #d4af37, #b8942a);
    border: none;
    padding: 10px;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
}

.cancel-btn {
    flex: 1;
    background: #2a2a35;
    border: none;
    padding: 10px;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    color: #b0b0b8;
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 12, 0.97);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-card {
    background: linear-gradient(145deg, #1a1a24, #12121a);
    padding: 35px;
    border-radius: 24px;
    width: 380px;
    border: 1px solid #d4af37;
    text-align: center;
}

.auth-logo {
    font-size: 3rem;
    margin-bottom: 10px;
}

.auth-card h2 {
    color: #d4af37;
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.auth-subtitle {
    color: #8a8a92;
    font-size: 0.8rem;
    margin-bottom: 25px;
}

.auth-card input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    background: #1e1e28;
    border: 1px solid #2a2a35;
    border-radius: 12px;
    color: #e8e6e3;
    font-size: 0.9rem;
}

.auth-card input:focus {
    outline: none;
    border-color: #d4af37;
}

.auth-card button {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: linear-gradient(135deg, #d4af37, #b8942a);
    border: none;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    color: #1a1a24;
    font-size: 1rem;
}

.register-btn {
    background: #2a2a35 !important;
    color: #b0b0b8 !important;
}

.auth-hint {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #2a2a35;
    font-size: 0.7rem;
    color: #6a6a72;
}

.auth-hint p {
    margin: 3px 0;
}

.error-msg {
    color: #ff6666;
    margin-top: 10px;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .craft-columns {
        grid-template-columns: 1fr;
    }
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}