:root {
    /* DARK THEME (DEFAULT) */
    --bg-main: #0e1117;
    --bg-card: #262730;
    --bg-darker: #1e1e1e;
    --text-main: #fafafa;
    --text-muted: #aaa;
    --border-color: #444;
    --hover-color: #333;
    --accent-color: #ff4b4b;
    --success-color: #2ecc71;
    --shadow: rgba(0, 0, 0, 0.3);

    /* NEW VARS */
    --table-header-bg: #363945;
    --chat-msg-bg: #333;
    --star-empty: #444;
}

[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-card: #f0f2f6;
    --bg-darker: #e8eaf0;
    --text-main: #31333f;
    --text-muted: #666;
    --border-color: #d0d0d0;
    --hover-color: #e0e0e0;
    --accent-color: #ff4b4b;
    --success-color: #27ae60;
    --shadow: rgba(0, 0, 0, 0.1);

    /* NEW VARS LIGHT */
    --table-header-bg: #e0e0e0;
    --chat-msg-bg: #e5e5e5;
    --star-empty: #ccc;
}

[data-theme="cookie"] {
    /* COOKIE THEME (YELLOW OVERLOAD) */
    --bg-main: #fff9c4;
    /* Pale Yellow */
    --bg-card: #ffeb3b;
    /* Vibrant Yellow */
    --bg-darker: #fbc02d;
    /* Dark Yellow */
    --text-main: #3e2723;
    /* Dark Brown (Chocolate Chip) */
    --text-muted: #5d4037;
    --border-color: #f57f17;
    --hover-color: #fff176;
    --accent-color: #f9a825;
    /* Deep Yellow/Orange */
    --success-color: #afb42b;
    /* Olive (Yellow-Green) */
    --shadow: rgba(0, 0, 0, 0.2);

    /* NEW VARS */
    --table-header-bg: #fdd835;
    --chat-msg-bg: #fff59d;
    --star-empty: #f57f17;
}

[data-theme="ronin"] {
    /* RONIN THEME (ACID GREEN) */
    --bg-main: #000000;
    /* Pitch Black */
    --bg-card: #050f05;
    /* Black-Green */
    --bg-darker: #000000;
    --text-main: #39ff14;
    /* NEON ACID GREEN */
    --text-muted: #32cd32;
    --border-color: #39ff14;
    /* ACID BORDERS */
    --hover-color: #1a4d1a;
    --accent-color: #ccff00;
    /* ACID LIME */
    --success-color: #00ff00;
    --shadow: 0 0 10px #39ff14;
    /* GLOW */

    /* NEW VARS */
    --table-header-bg: #0f3d0f;
    --chat-msg-bg: #0a1f0a;
    --star-empty: #1b5e20;
}

[data-theme="camel"] {
    /* CAMEL THEME (TOBACCO DESERT) */
    --bg-main: #e6b85c;
    /* Camel Yellow/Gold */
    --bg-card: #c19a4b;
    /* Darker Gold */
    --bg-darker: #a0803e;
    /* Shadow Gold */
    --text-main: #3e2723;
    /* Dark Brown */
    --text-muted: #5d4037;
    --border-color: #795548;
    /* Brown Border */
    --hover-color: #d4a753;
    --accent-color: #d35400;
    /* Burnt Orange */
    --success-color: #2e7d32;
    /* Cactus Green */
    --shadow: rgba(62, 39, 35, 0.3);

    /* NEW VARS */
    --table-header-bg: #b08d45;
    --chat-msg-bg: #e1c699;
    --star-empty: #8d6e63;
}

/* Background Image for Camel Theme */
[data-theme="camel"] body {
    background-image: url('/static/img/camel.png');
    background-repeat: repeat;
    background-size: 300px;
    /* Adjust size to make it visible everywhere */
    background-blend-mode: overlay;
    /* Blend with yellow background */
}

/* Ensure cards are semi-transparent so background shows through slightly? 
   Or keeps them solid to be readable. 
   User said "everywhere", so maybe opacity on cards?
*/
[data-theme="camel"] .sidebar,
[data-theme="camel"] .main-content,
[data-theme="camel"] .metric-card,
[data-theme="camel"] .task-table,
[data-theme="camel"] .kanban-column,
[data-theme="camel"] .kanban-card {
    /* Ensure background image doesn't clash with text */
    /* Add a subtle transparency if needed, but 'multiply' might overlap too much */
}

[data-theme="miku"] {
    /* MIKU THEME (CYAN & WHITE) */
    --bg-main: #f0fbfc;
    /* Very pale cyan */
    --bg-card: rgba(255, 255, 255, 0.9);
    /* White with slight transparency */
    --bg-darker: #e0f2f1;
    /* Light Teal */
    --text-main: #37474f;
    /* Dark Blue-Grey */
    --text-muted: #607d8b;
    --border-color: #b2dfdb;
    /* Teal Border */
    --hover-color: #e0f7fa;
    --accent-color: #39c5bb;
    /* MIKU CYAN */
    --success-color: #26a69a;
    --shadow: rgba(57, 197, 187, 0.2);

    /* NEW VARS */
    --table-header-bg: #b2dfdb;
    --chat-msg-bg: #e0f2f1;
    --star-empty: #b0bec5;
}

[data-theme="miku"] body {
    background-image: url('/static/img/miku.png');
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
    background-size: 400px;
    /* Large mascot in corner */
}

[data-theme="nanao"] {
    /* NANAO THEME (INDIGO & LAVENDER) */
    --bg-main: #ede7f6;
    /* Deep Purple 50 (Lavender) */
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-darker: #d1c4e9;
    /* Deep Purple 100 */
    --text-main: #1a237e;
    /* Indigo 900 */
    --text-muted: #5e35b1;
    /* Deep Purple 600 */
    --border-color: #7986cb;
    /* Indigo 300 */
    --hover-color: #e8eaf6;
    --accent-color: #d81b60;
    /* Pink 600 (Scarf/Blush) */
    --success-color: #7b1fa2;
    /* Purple 700 */
    --shadow: rgba(26, 35, 126, 0.15);

    /* NEW VARS */
    --table-header-bg: #c5cae9;
    --chat-msg-bg: #e8eaf6;
    --star-empty: #9fa8da;
}

[data-theme="nanao"] body {
    /* Layer gradients over the image to fade it into the background color */
    background-image:
        linear-gradient(to top, rgba(237, 231, 246, 0) 0%, #ede7f6 100%),
        linear-gradient(to left, rgba(237, 231, 246, 0) 0%, #ede7f6 100%),
        url('/static/img/nanao.png');
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: bottom right, bottom right, bottom right;
    background-attachment: fixed, fixed, fixed;
    background-size: 350px, 350px, 350px;
}

[data-theme="gachi"] {
    /* GACHI THEME (LEATHER & SKIN) */
    --bg-main: #212121;
    /* Dark Grey Leather */
    --bg-card: #424242;
    /* Lighter Leather */
    --bg-darker: #121212;
    /* Deep Dark */
    --text-main: #f0e68c;
    /* Khaki (Skin-ish) */
    --text-muted: #bdbdbd;
    /* Silver */
    --border-color: #616161;
    --hover-color: #616161;
    --accent-color: #2196f3;
    /* Jeans Blue */
    --success-color: #4caf50;
    --shadow: rgba(0, 0, 0, 0.5);

    /* NEW VARS */
    --table-header-bg: #424242;
    --chat-msg-bg: #424242;
    --star-empty: #757575;
}

[data-theme="gachi"] body {
    background-image: url('/static/img/billy.png');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-attachment: fixed;
    background-size: contain;
    /* Full impact */
    background-blend-mode: overlay;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 2px 0 5px var(--shadow);
    z-index: 10;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed {
    margin-left: -290px;
}

.sidebar h2 {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

/* USER SECTION */
.user-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn {
    background: var(--border-color);
    border: none;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.user-info-row {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-task-btn {
    width: 100%;
    padding: 12px;
    background: var(--success-color);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 20px;
}

.new-task-btn:hover {
    background: #27ae60;
}

.sidebar-label {
    font-size: 0.8em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.nav-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 5px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-main);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.nav-btn:hover {
    background: var(--hover-color);
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* RED HEADER BAR */
.main-header {
    background-color: var(--accent-color);
    height: 40px;
    /* Streamlit style thin bar */
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
}

.main-scroll-area {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* CONTROLS STACK (Vertical) */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 15px;
}

.search-input,
.status-select {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
}

.search-input {
    flex: 3;
}

.status-select {
    flex: 1;
}

.full-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    margin-top: 0;
    /* Override generic button margin */
}

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

.full-btn.active {
    background: var(--border-color);
    border-left: 5px solid var(--accent-color);
    /* Simple active indicator or just darker */
}

.refresh-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #2ecc71;
    color: #2ecc71;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    margin-top: 0;
}

.refresh-btn:hover {
    background: rgba(46, 204, 113, 0.1);
}



.dashboard-metrics {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card {
    flex: 1;
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.metric-card h3 {
    margin: 0 0 5px 0;
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-card span {
    font-size: 1.5em;
    font-weight: bold;
}

.overdue {
    border: 1px solid #ff4b4b;
}

.overdue span {
    color: #ff4b4b;
}

.warning {
    border: 1px solid #ffa502;
}

.warning span {
    color: #ffa502;
}

.ok {
    border: 1px solid #2ecc71;
}

.ok span {
    color: #2ecc71;
}

.info {
    border: 1px solid #3498db;
}

.info span {
    color: #3498db;
}

/* TABLE */
.task-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

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

.task-table th {
    background: var(--table-header-bg);
}

.task-row:hover {
    background: var(--hover-color);
    cursor: pointer;
}

/* KANBAN */
.kanban-board {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    overflow-x: auto;
}

.kanban-column {
    flex: 1;
    min-width: 300px;
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
}

.kanban-card {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    width: 80%;
    max-width: 900px;
    height: 85%;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    gap: 20px;
}

.task-main {
    flex: 2;
    border-right: 1px solid var(--border-color);
    padding-right: 20px;
}

.task-sidebar {
    flex: 1;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-main);
}

.chat-box {
    background: var(--bg-darker);
    border-radius: 6px;
    padding: 10px;
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 6px;
    background: var(--chat-msg-bg);
}

/* RATING */
.star {
    font-size: 1.5em;
    color: var(--star-empty);
    cursor: pointer;
}

.star.active {
    color: #f1c40f;
}

/* Login */
.login-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    border: 1px solid var(--border-color);
}

[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-card: #f0f2f6;
    --bg-darker: #e8eaf0;
    --text-main: #31333f;
    --text-muted: #666;
    --border-color: #d0d0d0;
    --hover-color: #e0e0e0;
    --accent-color: #ff4b4b;
    --success-color: #27ae60;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 2px 0 5px var(--shadow);
    z-index: 10;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed {
    margin-left: -290px;
}

.sidebar h2 {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

/* USER SECTION */
.user-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.75em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn {
    background: var(--border-color);
    border: none;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.user-info-row {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-task-btn {
    width: 100%;
    padding: 12px;
    background: var(--success-color);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 20px;
}

.new-task-btn:hover {
    background: #27ae60;
}

.sidebar-label {
    font-size: 0.8em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.nav-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 5px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-main);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.nav-btn:hover {
    background: var(--hover-color);
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* RED HEADER BAR */
.main-header {
    background-color: var(--accent-color);
    height: 40px;
    /* Streamlit style thin bar */
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 20;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
}

.main-scroll-area {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* CONTROLS STACK (Vertical) */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 15px;
}

.search-input,
.status-select {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
}

.search-input {
    flex: 3;
}

.status-select {
    flex: 1;
}

.full-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    margin-top: 0;
    /* Override generic button margin */
}

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

.full-btn.active {
    background: var(--border-color);
    border-left: 5px solid var(--accent-color);
    /* Simple active indicator or just darker */
}

.refresh-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #2ecc71;
    color: #2ecc71;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    margin-top: 0;
}

.refresh-btn:hover {
    background: rgba(46, 204, 113, 0.1);
}


/* METRICS */
.metric-card {
    flex: 1;
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.metric-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-card span {
    font-size: 2em;
    font-weight: bold;
}

.overdue {
    border: 1px solid #ff4b4b;
}

.overdue span {
    color: #ff4b4b;
}

.warning {
    border: 1px solid #ffa502;
}

.warning span {
    color: #ffa502;
}

.ok {
    border: 1px solid #2ecc71;
}

.ok span {
    color: #2ecc71;
}

.info {
    border: 1px solid #3498db;
}

.info span {
    color: #3498db;
}

/* TABLE */
.task-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

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

.task-table th {
    background: #363945;
}

.task-row:hover {
    background: #444;
    cursor: pointer;
}

/* KANBAN */
.kanban-board {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    overflow-x: auto;
}

.kanban-column {
    flex: 1;
    min-width: 300px;
    background: var(--bg-darker);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #333;
}

.kanban-card {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    width: 80%;
    max-width: 900px;
    height: 85%;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    gap: 20px;
}

.task-main {
    flex: 2;
    border-right: 1px solid #444;
    padding-right: 20px;
}

.task-sidebar {
    flex: 1;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: white;
}

.chat-box {
    background: var(--bg-darker);
    border-radius: 6px;
    padding: 10px;
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.chat-msg {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 6px;
    background: #333;
}

/* RATING */
.star {
    font-size: 1.5em;
    color: #444;
    cursor: pointer;
}

.star.active {
    color: #f1c40f;
}

/* Login */
.login-container {
    background: rgba(38, 39, 48, 0.9);
    padding: 40px;
    border-radius: 10px;
    width: 300px;
    text-align: center;
    border: 1px solid #464b5f;
}

@keyframes blink {
    0% {
        border-color: #ff4b4b;
        box-shadow: 0 0 5px #ff4b4b;
    }

    50% {
        border-color: transparent;
        box-shadow: none;
    }

    100% {
        border-color: #ff4b4b;
        box-shadow: 0 0 5px #ff4b4b;
    }
}

.blink-anim {
    animation: blink 1s infinite;
    border: 2px solid #ff4b4b !important;
}

/* Drag and Drop */
.kanban-column.drag-over {
    background-color: #3d3e4a;
    border: 2px dashed #3498db;
}

.kanban-card[draggable="true"] {
    cursor: grab;
}

.kanban-card.dragging {
    opacity: 0.5;
    background-color: #444;
    cursor: grabbing;
}

/* Drag and Drop Enhanced */
.kanban-column {
    transition: background-color 0.2s, box-shadow 0.2s;
}

.kanban-column.drag-over {
    background-color: #2c3e50 !important;
    box-shadow: inset 0 0 10px rgba(52, 152, 219, 0.5);
    border: 2px dashed #3498db;
}

/* Card Styling for NAISDesk Feel */
.kanban-card {
    background: var(--bg-card);
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
}

.kanban-card:hover {
    background-color: var(--hover-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.kanban-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
    transform: scale(0.98);
}

/* --- FIXED BUTTONS STYLES --- */
button,
select,
input,
textarea {
    font-family: inherit;
}

/* Ensure all buttons use theme vars by default if not overridden */
button:not(.sidebar-toggle):not(.close-btn) {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

button:hover:not(.sidebar-toggle):not(.close-btn) {
    background-color: var(--hover-color);
}

/* Specific Classes used in JS/HTML */
.view-btn,
.action-btn,
.filter-select {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.view-btn:hover,
.action-btn:hover,
.filter-select:hover {
    background-color: var(--hover-color) !important;
}

.view-btn.active {
    background-color: var(--accent-color) !important;
    color: white !important;
    border-color: var(--accent-color) !important;
}

.view-btn {
    margin-right: 5px;
}

/* Fix Selects to be dark */
select {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}


/* --- NEW MODAL STYLES (Redesign) --- */

.section-label {
    display: block;
    font-size: 0.75em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.description-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 6px;
    min-height: 100px;
    white-space: pre-wrap;
    line-height: 1.5;
    color: #eee;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.chat-container {
    flex: 1;
    background: transparent;
    /* Remove box style, make it flow */
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    overflow-y: auto;
    max-height: 400px;
}

.chat-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #333;
    position: relative;
    max-width: 85%;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: white;
}

.sidebar-group {
    margin-bottom: 5px;
}

.actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-btn-small {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 10px;
    font-size: 0.85em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-small:hover {
    background: var(--hover-color);
    color: white !important;
    border-color: white !important;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    background: #444;
}

.priority-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
}

.tiny-btn {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
}

.tiny-btn:hover {
    color: white;
    border-color: #888;
}

.tiny-input {
    background: transparent;
    border: 1px solid #555;
    color: white;
    font-size: 0.8em;
    padding: 2px 4px;
    width: 60px;
}