:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 50px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tabs {
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Styles */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.sorting-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
    height: calc(100vh - 200px);
    align-items: start;
}

.main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 15px;
    padding-bottom: 20px;
}

.others-sidebar {
    position: sticky;
    top: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.others-sidebar .category-card {
    height: 100%;
    min-height: 500px;
}

.others-sidebar .items-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Custom scrollbar for items containers */
.items-container::-webkit-scrollbar {
    width: 6px;
}
.items-container::-webkit-scrollbar-track {
    background: transparent;
}
.items-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.items-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Custom scrollbar for main grid */
.main-grid::-webkit-scrollbar {
    width: 8px;
}
.main-grid::-webkit-scrollbar-track {
    background: transparent;
}
.main-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.main-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Search Bar in others card */
.others-search-container {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid var(--border);
}

.others-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.others-search-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.category-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.card-header {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.item-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.items-container {
    padding: 15px;
    flex-grow: 1;
    min-height: 100px;
    max-height: 500px;
    overflow-y: auto;
}

.item-tile {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.1s, box-shadow 0.1s;
}

.item-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--primary);
}

.item-left-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #f1f5f9;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.item-tile:hover .row-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.item-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Settings Styles */
.settings-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.add-category-form {
    display: flex;
    gap: 10px;
    margin: 20px 0 30px;
}

#new-category-name, .modal-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#new-category-name:focus, .modal-input:focus {
    border-color: var(--primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }

.btn-secondary { background: var(--border); color: var(--text-main); }

.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active { display: flex; }

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 400px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Sortable Placeholders */
.ghost {
    opacity: 0.4;
    background: #cbd5e1 !important;
}

.chosen {
    border-color: var(--primary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    transform: translateY(100px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
}

.toast.show {
    transform: translateY(0);
}
