/* Muji-style Minimalist CSS */

:root {
    --bg: #ffffff;
    --text: #2c2c2c;
    --text-light: #777;
    --line: #eee;
    --accent: #000;
    --danger: #d00;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono-stack: "SF Mono", "Menlo", "Monaco", "Courier New", monospace;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-stack);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.layout { max-width: 960px; margin: 0 auto; padding: 40px 20px; }

/* Header */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; }
.brand { font-size: 18px; font-weight: 500; letter-spacing: -0.5px; color: var(--accent); }

/* Buttons */
button { cursor: pointer; font-family: inherit; font-size: 13px; transition: all 0.2s ease; }

.btn-primary, .btn-black {
    background: #000; color: #fff; border: 1px solid #000;
    padding: 8px 16px; border-radius: 2px;
}
.btn-primary:hover, .btn-black:hover { background: #333; border-color: #333; }

.btn-text { background: none; border: none; padding: 0; color: var(--text-light); text-decoration: underline; }
.btn-text:hover { color: var(--accent); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { color: #a00; }

/* Table */
.table-container { margin-bottom: 60px; }
.muji-table { width: 100%; border-collapse: collapse; text-align: left; }
.muji-table th { 
    font-weight: 600; color: #999; text-transform: uppercase; font-size: 11px; letter-spacing: 1px;
    padding: 10px 0; border-bottom: 1px solid var(--line);
}
.muji-table td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.muji-table tr:last-child td { border-bottom: none; }

.cell-duo .mono { font-family: var(--mono-stack); font-size: 13px; font-weight: 500; }
.cell-role .role-tag { 
    font-size: 11px; text-transform: uppercase; padding: 2px 6px; background: #f4f4f4; color: #555; border-radius: 2px; 
}
.cell-ms .ms-link { color: var(--text-light); }
.cell-ms .ms-link.inactive { font-style: italic; color: #ccc; }
.cell-action { text-align: right; }

/* Logs */
.logs-section h3 { font-size: 12px; text-transform: uppercase; color: #999; margin-bottom: 10px; font-weight: 600; letter-spacing: 0.5px; }
.logs-window { 
    background: #fafafa; padding: 15px; font-family: var(--mono-stack); font-size: 11px; color: #666; 
    height: 150px; overflow-y: auto; white-space: pre-wrap; border-radius: 2px;
}

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.9); /* Very light backdrop */
    z-index: 1000; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.modal.active { display: flex; opacity: 1; }

.modal-surface {
    background: #fff; width: 400px; padding: 40px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); border: 1px solid #eee;
    transform: translateY(10px); transition: transform 0.2s;
}
.modal.active .modal-surface { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; margin-bottom: 30px; }
.modal-header h2 { font-size: 16px; font-weight: 500; margin: 0; }
.close-modal { background: none; border: none; font-size: 24px; color: #ccc; line-height: 1; padding: 0; }
.close-modal:hover { color: #000; }

/* Forms */
.field { margin-bottom: 24px; }
label { display: block; font-size: 12px; font-weight: 600; color: #999; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
input[type="text"] {
    width: 100%; padding: 8px 0; border: none; border-bottom: 1px solid #ddd; 
    font-family: inherit; font-size: 14px; background: transparent; border-radius: 0;
}
input[type="text"]:focus { outline: none; border-bottom-color: #000; }
.mono-input { font-family: var(--mono-stack); }

.select-wrapper { position: relative; }
select {
    width: 100%; padding: 8px 0; border: none; border-bottom: 1px solid #ddd;
    font-family: inherit; font-size: 14px; background: transparent; appearance: none; border-radius: 0; cursor: pointer;
}
select:focus { outline: none; border-bottom-color: #000; }

.helper-text { font-size: 11px; color: #ccc; margin-top: 6px; }

.modal-actions { margin-top: 40px; text-align: right; }
.modal-actions.split { display: flex; justify-content: space-between; align-items: center; }

/* Flashes */
.messages { margin-bottom: 30px; }
.msg { padding: 12px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.msg.success { color: #2c662d; }
.msg.error { color: #a94442; }
