@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: ;
    --accent-color: #f4f7f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(0,0,0,0.1); /* To be overridden with accent color hex via script if possible, or using opacity trick */
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content {
    padding: 40px;
    flex-grow: 1;
    animation: fadeIn 0.6s ease-out forwards;
    max-width: 1400px;
    margin: 0 auto;
}

h1, h2, h3, h4, h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 15px;
}

h1 {
    font-size: 2rem;
    letter-spacing: -0.02em;
    padding-bottom: 20px;
}

/* Header Re-Design */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    background: var(--accent-color);
    color: #fff;
    height: 70px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left { display: flex; align-items: center; }
.site-name { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }

.header-right { display: flex; align-items: center; }
.header-right img {
    height: 40px; width: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    object-fit: cover;
    transition: var(--transition);
}
.header-right img:hover { border-color: #fff; transform: scale(1.05); }

/* Buttons Overhaul */
button, .btn, .btn-primary, .dropbtn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-md);
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

button:hover, .btn:hover, .btn-primary:hover, .dropbtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    filter: brightness(1.1);
}

.btn-delete, .btn-remove { background-color: #ef4444; }
.btn-delete:hover, .btn-remove:hover { background-color: #dc2626; box-shadow: 0 4px 12px rgba(220,38,38,0.3); }

.btn-edit { background-color: #3b82f6; }
.btn-edit:hover { background-color: #2563eb; }

.btn-view { background-color: #10b981; }
.btn-view:hover { background-color: #059669; }

.btn-return {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
}
.btn-return:hover {
    background: #f3f4f6;
    color: var(--text-primary);
    transform: translateX(-3px);
    box-shadow: none;
}

/* Cards (Glassmorphism inspired clean look) */
.card, .movimentacao-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.7);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Inputs & Forms */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], textarea, select {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0 20px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: #f9fafb;
    transition: var(--transition);
    box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0,0,0, 0.05);
}

label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: inline-block;
}

/* Table Design */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

th {
    background-color: #f9fafb;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:hover td {
    background-color: #f3f4f6;
}

tr:last-child td {
    border-bottom: none;
}

/* Action Icons inside table */
.action-icons { display: flex; gap: 8px; align-items: center; }
.action-icons .btn { padding: 8px 12px; margin: 0; }

/* Kanban Board Redesign */
.kanban-board {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    overflow-x: auto;
    padding-bottom: 15px;
}

.kanban-column {
    background: #f3f4f6;
    border-radius: var(--border-radius-lg);
    padding: 15px;
    width: 350px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.kanban-column h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: left;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 15px;
}

.kanban-column-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for Kanban */
.kanban-column-content::-webkit-scrollbar { width: 6px; }
.kanban-column-content::-webkit-scrollbar-track { background: transparent; }
.kanban-column-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.kanban-column-content::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.kanban-card {
    background: #fff;
    border-radius: var(--border-radius-md);
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: grab;
    transition: var(--transition);
}

.kanban-card:active { cursor: grabbing; transform: scale(0.98); }
.kanban-card:hover { 
    box-shadow: var(--shadow-md); 
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.kanban-card h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--text-primary); }
.kanban-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.kanban-card .action-icons { margin-top: 15px; border-top: 1px solid #f1f5f9; padding-top: 12px; }

/* Dashboard Cards (Mais Acessadas) */
.mais-acessadas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 20px 0;
    list-style: none;
    background: transparent;
}

.mais-acessadas .card {
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 4px solid var(--accent-color);
}
.mais-acessadas .card a {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}
.mais-acessadas .card a:hover { color: var(--accent-color); }

/* Dropdown User Menu */
.dropdown-content {
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    right: 0;
}
.dropdown-content a {
    padding: 12px 20px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.dropdown-content a:hover { background-color: var(--bg-color); color: var(--accent-color); }

/* Custom Select Dropdowns */
.custom-select-wrapper { position: relative; margin-bottom: 20px; }
.select-btn {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.95rem;
}
.select-btn:after { content: '\f0d7'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--text-secondary); }

/* File Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px 20px;
    text-align: center;
    background: #f9fafb;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(0,0,0,0.02);
    color: var(--accent-color);
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .kanban-board { flex-direction: column; height: auto; overflow: visible; }
    .kanban-column { width: 100%; min-height: 300px; margin-bottom: 20px; }
}

@media screen and (max-width: 768px) {
    .content { padding: 20px; }
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { display: none; }
    tr { margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); box-shadow: var(--shadow-sm); }
    td { text-align: right; position: relative; padding-left: 50%; border: none; border-bottom: 1px solid #f3f4f6; }
    td:last-child { border-bottom: none; }
    td:before {
        content: attr(data-label);
        position: absolute; left: 15px;
        width: 45%; padding-right: 10px;
        white-space: nowrap; text-align: left; font-weight: 600;
        color: var(--text-secondary);
    }
}